pipes like perl

max(01)* max2 at fisso.casa
Tue Aug 23 20:40:25 CEST 2005


bruno modulix wrote:
> max(01)* wrote:
> 
>>hi.
> 
> 
> (snip)
> 
> 
>>it doesn't work, since "*do_something*" and *do_something_more* are
>>always executed (it seems like
>>
>>MYPIPE = os.popen("*some_system_command*", "r")
>>
>>does not raise any exception even if *some_system_command* does not
>>exist/work...
>>
>>any help?
> 
> 
> http://www.python.org/doc/2.4.1/lib/os-newstreams.html#os-newstreams
> """
> The exit status of the command (encoded in the format specified for
> wait()) is available as the return value of the close() method of the
> file object, except that when the exit status is zero (termination
> without errors), None is returned.
> """

but i need to check the success/failure of the external command *before* 
closing the file!



More information about the Python-list mailing list