Re: [Tutor] Capture command output

2005-11-03 Thread Alan Gauld
> You cannot run any function at all in your script after you do the exec > call, it is no longer your program, but the one you exec-ed. popen > actually runs the subprocess, you don't have to call it manually. Popen > is the most used way to get the output, and looks like it is the only > one

Re: [Tutor] Capture command output

2005-11-03 Thread Hugo González Monteverde
Hi, Here's the docs for the popen2 module in python 2.2, the Popen2 object allows you to get the pid. The popen2() call allows you to get the output in a filehandle. http://www.python.org/doc/2.2.3/lib/module-popen2.html You cannot run any function at all in your script after you do the exec

Re: [Tutor] Capture command output

2005-11-03 Thread Johan Geldenhuys
The version of python that I have is 2.2.2 and I can't upgrade, sorry. As far as I know this only from version 2.4.2?? Johan Kent Johnson wrote: Johan Geldenhuys wrote: I've been musy with the os command on how to kill a process. That's been sorted out to an extend. Many thanks

Re: [Tutor] Capture command output

2005-11-03 Thread Kent Johnson
Johan Geldenhuys wrote: > I've been musy with the os command on how to kill a process. That's been > sorted out to an extend. Many thanks for your input. > > Now I have a question in the same direction: > > I use os.execpv(cmd, [cmd, args]). That executes the command that have > output. This wa

[Tutor] Capture command output

2005-11-02 Thread Johan Geldenhuys
I've been musy with the os command on how to kill a process. That's been sorted out to an extend. Many thanks for your input. Now I have a question in the same direction: I use os.execpv(cmd, [cmd, args]). That executes the command that have output. This was the best way of getting the pid and