pipes like perl

bruno modulix onurb at xiludom.gro
Tue Aug 23 13:55:28 EDT 2005


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.
"""


-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list