shell script stdout to python string?

Jeff Learman jlearman at cisco.com
Thu May 20 14:46:12 EDT 2004


Hi -- sorry for not searching first, but I get an NNTP error from 
netscape (a known bug, still looking for workaround).

Inside a python script, I want to execute a UNIX command and
send the output to a Python string, returning the shell return
code value as an integer or exception.

I'm sure I could write a function using pipes and whatnot, but
I'm hoping this is a solved problem by now, more elegantly and
correctly coded than my hack job would be.

Thanks,
Jeff

Python rocks, btw.  I've almost broken the #!/bin/ksh habit ;)




More information about the Python-list mailing list