Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 2nd, 2005, 06:15 PM
chuck
Guest
 
Posts: n/a
Default pre subprocess help needed

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?

  #2  
Old August 2nd, 2005, 06:45 PM
Chris Lambacher
Guest
 
Posts: n/a
Default Re: pre subprocess help needed

There is a version of subprocess for 2.3.
http://www.lysator.liu.se/~astrand/popen5/
http://effbot.org/downloads/#subprocess


On Tue, Aug 02, 2005 at 10:05:00AM -0700, chuck wrote:[color=blue]
> 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?
>
> --
> http://mail.python.org/mailman/listinfo/python-list[/color]
  #3  
Old August 2nd, 2005, 08:45 PM
wittempj@hotmail.com
Guest
 
Posts: n/a
Default Re: pre subprocess help needed

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

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles