[Tutor] Question about subprocess

eryksun eryksun at gmail.com
Sat Jan 11 10:26:00 CET 2014


On Sat, Jan 11, 2014 at 12:51 AM, Steven D'Aprano <steve at pearwood.info> wrote:
>
>> However, when I writed it into a .py file and execute the .py file, it
>> blocked at "temp=p.readline()".
>
> Of course it does. You haven't actually called the .exe file, all you
> have done is created a Popen instance and then grabbed a reference to
> it's stdout. Then you sit and wait for stdout to contain data, which it
> never does.

Popen.__init__ calls Popen._execute_child, which on Windows is defined
to call _subprocess.CreateProcess. So the issue can't be that the OP
hasn't "called the .exe".


More information about the Tutor mailing list