Re: subprocess -popen - reading stdout from child - hangs

2007-09-24 Thread [EMAIL PROTECTED]
On Sep 23, 2:58 am, Karthik Gurusamy [EMAIL PROTECTED] wrote: On Sep 22, 8:28 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Let's say I have this Python file called loop.py: import sys print 'hi' sys.stdout.flush() Add sys.stdout.close() Adding sys.stdout.close() and removing

Re: subprocess -popen - reading stdout from child - hangs

2007-09-24 Thread Karthik Gurusamy
On Sep 24, 2:22 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Sep 23, 2:58 am, Karthik Gurusamy [EMAIL PROTECTED] wrote: On Sep 22, 8:28 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Let's say I have this Python file called loop.py: import sys print 'hi' sys.stdout.flush()

Re: subprocess -popen - reading stdout from child - hangs

2007-09-23 Thread Suresh Babu Kolla
[EMAIL PROTECTED] wrote: Let's say I have this Python file called loop.py: import sys print 'hi' sys.stdout.flush() while 1: pass And I want to call it from another Python process and read the value 'hi'. How would I do it? So far I have tried this: proc =

Re: subprocess -popen - reading stdout from child - hangs

2007-09-23 Thread Karthik Gurusamy
On Sep 22, 8:28 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Let's say I have this Python file called loop.py: import sys print 'hi' sys.stdout.flush() Add sys.stdout.close() while 1: pass And I want to call it from another Python process and read the value 'hi'. How would I do

Re: subprocess -popen - reading stdout from child - hangs

2007-09-23 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: Let's say I have this Python file called loop.py: import sys print 'hi' sys.stdout.flush() while 1: pass And I want to call it from another Python process and read the value 'hi'. How would I do it? So far I have tried

Re: subprocess -popen - reading stdout from child - hangs

2007-09-23 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: Well, using this subclass of subprocess.Popen fixes the problem (http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440554) I don't understand how it works though. Would anyone mind explaining? I'm thinking there's something

subprocess -popen - reading stdout from child - hangs

2007-09-22 Thread [EMAIL PROTECTED]
Let's say I have this Python file called loop.py: import sys print 'hi' sys.stdout.flush() while 1: pass And I want to call it from another Python process and read the value 'hi'. How would I do it? So far I have tried this: proc = subprocess.Popen('python

Re: subprocess -popen - reading stdout from child - hangs

2007-09-22 Thread [EMAIL PROTECTED]
On Sep 22, 11:28 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Let's say I have this Python file called loop.py: import sys print 'hi' sys.stdout.flush() while 1: pass And I want to call it from another Python process and read the value 'hi'. How would I do it? So far I have