pre subprocess help needed

C

chuck

I need to execute a command shell process obtain the return code and
capture stdout from that shell process. I've done this with 2.4 using
subprocess. How do I do it with 2.3?
 
W

wittempj

You can also use the spawn functions in os, together with the P_WAIT
mode.

os.spawnlp(os.P_WAIT, 'ls', 'ls')
gconfd-martin kde-martin mcop-martin ssh-PhJzdB6333
gpg-bSRhOE ksocket-martin orbit-martin
0
os.spawnlp(os.P_WAIT, 'spam', 'spam')
127
 

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

Forum statistics

Threads
474,262
Messages
2,571,311
Members
47,981
Latest member
satome

Latest Threads

Top