How to parse the os.system() output in python

bruce peng pengning at kingsoft.net
Sun Mar 18 00:40:06 EDT 2007


how to redirect the putput of the
program to a file?

thanks.
"Sebastian Bassi" <sbassi at clubdelarazon.org> wrote in message 
news:mailman.5237.1174189740.32031.python-list at python.org...
> On 17 Mar 2007 17:28:56 -0700, yinglcs at gmail.com <yinglcs at gmail.com> 
> wrote:
>> I use os.system() to execute a system command in python.
>> Can you please tell me how can I parse (in python) the output of the
>> os.system()  ?
>
> Maybe you mean to parse the output of the program you run using
> os.system. If this is the case, you should redirect the putput of the
> program to a file (with ">") and then parse that file.
>
> Best,
> SB. 





More information about the Python-list mailing list