Saving python script to linino RAM and running script

I’m trying to run a python script that I’m saving to the linino RAM. I can’t get the arduino to return the last “print” line from my python code. Can anyone tell me what I’m doing wrong?

#include <FileIO.h>

void setup() {
// Setup Bridge (needed every time we communicate with the Arduino Yún)
// Initialize the Serial

while(!Serial); // wait for Serial port to connect.
Serial.println(“File Write Script example\n\n”);

// Setup File IO

// Upload script used to gain network statistics

void loop()
// Run stats script every 5 secs.
Serial.println(“Just ran script”);

void uploadScript()

// Using /tmp stores the script in RAM this way we can preserve
// the limited amount of FLASH erase/write cycles
File script ="/tmp/", FILE_WRITE);
script.print(“import urllib2”);
script.print(“import ast”);
script.print(“r = urllib2.urlopen(‘’)”);
script.print(“a =”);
script.print(“y = ast.literal_eval(a)”);
script.print(“print a[“key123”]”); //I want to index a certain part of the dictionary
script.close(); // close the file

// Make the script executable
Process chmod;
chmod.begin(“chmod”); // chmod: change mode
chmod.addParameter("+x"); // x stays for executable
chmod.addParameter("/tmp/"); // path to the file to make it executable;

// this function run the script and read the output data
void runScript()
// Run the script and show results on the Serial
Process myscript;

String output = “”;

// read the output of the script
while (myscript.available())
output += (char);
// remove the blank spaces at the beginning and the ending of the string
Serial.println(“just ran”);