Repost: Read a running process output

Ashok Prabhu ashokprabhuv at gmail.com
Fri Feb 5 07:53:05 EST 2010


On Feb 5, 5:12 pm, Alain Ketterlin <al... at dpt-info.u-strasbg.fr>
wrote:
> Ashok Prabhu <ashokprab... at gmail.com> writes:
> > from subprocess import *
> > p1=Popen('/usr/sunvts/bin/64/vtsk -d',stdout=PIPE,shell=True)
>
> Use Popen(['/usr/...','-d'],stdout=PIPE), i.e., no shell.
>
> -- Alain.

Hi Alain,

Thanks for the response. However it throws an error. Please find
below.

>>> from subprocess import *
>>> p1=Popen('/usr/sunvts/bin/64/vtsk -d',stdout=PIPE)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.4/subprocess.py", line 543, in __init__
    errread, errwrite)
  File "/usr/lib/python2.4/subprocess.py", line 975, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Thanks,
~Ashok.



More information about the Python-list mailing list