python equivalent of the following program
Edward Elliott
nobody at 127.0.0.1
Thu May 11 20:39:10 EDT 2006
AndyL wrote:
> Edward Elliott wrote:
>> And if the script runs somewhere that stderr is likely to disappear:
>>
>> prog1 = subprocess.Popen(['prog1'], stdout=file1,
>> stderr=subprocess.STDOUT)
>
> Forgot to mention before that the main motivation is to have the same
> code on bot Linux and M$ platforms.
>
> Does subprocess work well on both?
yes
> Also how to find out that the 'prog1' e.g. has exited and it is done?
prog1.wait() or prog1.poll(). look at the subprocess docs.
More information about the Python-list
mailing list