shell script stdout to python string?

J

Jeff Learman

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 ;)
 
J

Jeff Learman

Thanks! Just what I was looking for ... don't know why I didn't
see it in the docs.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top