PDA

View Full Version : coding in python using os.system ,(works on scratchbox but not on N900), Urgent pls help


wrapster
11-29-2009, 10:30 AM
Hi all,

Recently for one of my apps i was using os.system() call. to execute a few shell toolkits...

But found out that everything apart from that (all the print statements) are working .. but only those with os.system fail..

I have "import os"
weird thing is that it works on scratchbox but now when put onto the phone.

Can any one please help me.. its a bit urgent as well..

if anyone can comfirm that something like this..
os.system("ls > process_output.log")
would work , it would be of really great help..

Also if there are any alternatives to using os.system. I would like to know..

Thanks...

Khertan
11-29-2009, 10:35 AM
if anyone can comfirm that something like this..
os.system("ls > process_output.log")
would work , it would be of really great help..

Works for me ...

But be carefull that on device you use busybox, not all option on all commands.

jkq
11-29-2009, 01:36 PM
Also if there are any alternatives to using os.system. I would like to know.

Yes, "import subprocess" is recommended by the Python docs.

-jkq