Why won't my python script print anything?

Here is code from a script I've written into the linux file system. I'm not sure why it isn't printing out.

File script = FileSystem.open("/tmp/example.py", FILE_WRITE);
script.print("#!/usr/bin/python\n");
script.print("import urllib2\n");
script.print("import ast\n");
script.print("r = urllib2.urlopen('https://example.api.call.returns.json')\n");
script.print("a = r.read()\n");
script.print("y = ast.literal_eval(a)\n");
script.print("print a");
script.close();

Process chmod;
chmod.begin("chmod"); // chmod: change mode
chmod.addParameter("+x"); // x stays for executable
chmod.addParameter("/tmp/example.py"); // path to the file to make it executable
chmod.run();
}

Process myscript;
myscript.begin("/tmp/example.py");
myscript.run();

String output = "";

while (myscript.available())
{
output += (char)myscript.read();
}
// remove the blank spaces at the beginning and the ending of the string
output.trim();
Serial.println(output);

Doesn't seem very Arduino-related (!) - or is the URL on an Arduino web sketch?

Did it write the file /tmp/example.py?

Is the URL correct?

Did the file /tmp/example.py get made executable?

Does the file /tmp/example.py run? What output does it produce?

I'm wondering why its writing a second script to do this, why not just read
the URL itself?

The file was created in the folder. I checked with ls -l /tmp. The URL is also correct. It prints out a json as a string and then the code turns it into a dictionary. I want to print the dictionary into the serial monitor.

The script running in my osx terminal runs perfectly. I don't know if I'm writing the script into the Linux file system on the arduino incorrectly or not. I want help with the code.