[maemo-developers] coding in python using os.system , (works on scratchbox but not on N900), Urgent pls help

From: Thomas Perl th.perl at gmail.com
Date: Mon Nov 30 18:09:23 EET 2009
2009/11/29 Anderson Lizardo <anderson.lizardo at openbossa.org>:
> On Sun, Nov 29, 2009 at 11:36 AM, shampavman <shampavman18 at gmail.com> wrote:
>> if anyone can confirm 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..
> If all you want is to get a list of files of a directory, try os.listdir():

In case you want to do more complicated things, please think about
using the "subprocess" module and its "Popen" object. It's really easy
and more reliable (e.g. you can read stdout/sterr directly instead of
having to use pipes and output redirection to files):


More information about the maemo-developers mailing list