[Tutor] Popen? or something else

Roger Merchberger zmerch at 30below.com
Wed Dec 22 21:47:45 CET 2004


Rumor has it that Ertl, John may have mentioned these words:
>Roger,
>
>I have been doing it the Pythonic way (that is why I have no idea about how
>Popen works) but I need to make sure (the systems guys called me on it)  I
>use the same dtg as everyone else...it is possible (has not happened yet in
>20 years) it could be set to something else.
>
>Is the example you gave using the new 2.4 Popen?  It looks like the older
>popen.  I can get the older popen to work but not Popen.

My newest is 2.3.3 - I had no idea they modified popen for 2.4, but try this:

dtg_s = Popen("/path/to/dtg", shell=True, stdout=PIPE).stdout

If I've read the dox for 2.4 correctly, this has almost a fair chance of 
working... ;-) I cannot test this, however, as I don't have 2.4. (Glad I 
didn't upgrade, either -- I have several programs that rely on the present 
os.popen() )

here's a good page with how the new Popen works:

http://www.python.org/peps/pep-0324.html

with examples on how to replace os.popen[234]() and os.system().

HTH,
Roger "Merch" Merchberger

--
Roger "Merch" Merchberger  --  SysAdmin, Iceberg Computers
zmerch at 30below.com

Hi! I am a .signature virus.  Copy me into your .signature to join in!



More information about the Tutor mailing list