Hi X_Y,
I apologize for the delay in my response. Take a look at the sketch below, in this way you can create, write, read and execute a python script from an Arduino sketch. I hope you find this helpful.
void setup() { // put your setup code here, to run once: FILE * fp; fp = fopen("/home/root/hello.py", "w"); fprintf(fp, "print \"Hello World!\"\n"); fprintf(fp, "print \"This is python script\"\n"); fclose(fp); delay(5000); Serial.begin(9600); system("python /home/root/hello.py > /dev/ttyGS0"); } void loop() { // put your main code here, to run repeatedly: }
Regards,
JPMontero_Intel