On Sat, 10 Jul 2004 14:41:51 -0700, John Finlay <[EMAIL PROTECTED]> wrote:
John Russell wrote:
On Sat, 10 Jul 2004 16:23:01 -0400, John Russell <[EMAIL PROTECTED]> wrote:
I suspect you're using: pipe = popen2.popen4(cmd) instead of pipe = popen2.Popen4(cmd) Notice the use of the capital P. The first executes a function that returns a tuple. The second creates a class instance.
Right again. Thanks. BTW. If I do end up os.kill()ing this process, do I have to close the input output pipes, or do they get closed automagically? Any other cleanup that is necessary?
Also, I wrote a perl script that outputs a line, sleeps for a second, and outputs another line for 15 seconds. WHen I run this command with Popen4 (yes the capital letter), nothing happens for 15 seconds and then all the output comes out at once. I ran the command like so
pipe = popen2.Popen4(command)
and also
pipe = popen2.Popen4(command,0)
in an attempt to stop it from buffeing the output. Is there anything elseI can do to flush the output when reading from pipe.fromchild?
You guys have been great. Thanks for all the help.
Are you sure that the perl script is flushing the output every second?
> It does when I call the command from the shell. Also, Perl flushes > whenever there is a \n. I have one at the end of each line. >
There are some strange things happening when stdout is a tty (interactive terminal). Have you tried flushing stdout manually from the perl script?
PS. Please reply under the quoted message. It is really much easier to read.
-- Regards, Jakub Piotr CÅapa _______________________________________________ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
