a sub process problem.

Rajarshi Guha rajarshi at presidency.com
Sun May 27 02:10:44 EDT 2001


i,
  I was writing a script to search my mail archives. After doing the search
I'd like to start Pine from the script and view the results. In addition
after the
exit of Pine I want the script to carry on - ie the script should wait until
the pine process finishes. I've tried using the popen2 class but I get the
following error:

Traceback (most recent call last):
  File "/home/rajarshi/src/misc/py/ptest.py", line 153, in ?
    print p.poll()
AttributeError: 'tuple' object has no attribute 'poll'

,where p = os.popen4("pine")

But the docs say that instances of popen2 and peopn4 have the methods poll()
and wait().  I also tried os.spawn(os.P_WAIT,"pine") but then the the
program just carries on and no pine comes up.

Could somebody please tell me where I'm going wrong and how I could solve
this problem.

PS. I'm doing all this under Linux and Python 2.1
TIA,


--
-------------------------------------------------------------
Rajarshi Guha

email: rajarshi at presidency.com
web: http:/www.psynet.net/jijog





More information about the Python-list mailing list