popen does indeed wait for the process to terminate.  This is the only
sensible thing as you are waiting for the programs output.

Use os.system() is you don't want to wait for termination nor read the
program's output.

Mark.

> -----Original Message-----
> From: Nahuel Greco [mailto:[EMAIL PROTECTED]]
> Sent: Monday, 26 March 2001 3:35 AM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Pipes opened with popen3 cant be closed!
>
>
> Hi, im doing the following thing in Windows 98 / Activestate Python 2.0:
>
>       import win32pipe
>
>       cmd = "c:\\zebedee\\zebedee.exe -d 127.0.0.1"
>       pipes = win32pipe.popen3(cmd,'t')
>
>       #Now.. if i do:
>
>       pipes[0].close()
>       pipes[1].close()
>       pipes[2].close()  # in this line, the program hangs.
>
>
> If i follow another closing order, the program stills hangs in the last
> close() call .. i think that when all the pipes are closed.. win32pipe
> try to close the child program.. and wait for that close.. but, the
> child program never exit.
>
> If i do not close the pipes, when my python script exits, the child
> program is still running (i dont want that).
>
> The zebedee.exe that im using is at
> http://www.winton.org.uk/zebedee/download.html
>
> Zebedee.exe is a program that doesnt exit inmediatly, it wait for
> tcp connections, and print the conections made to stderr (using -d
> "detach" flag). You can emulate it with:
>
>
>       import time
>       import sys
>
>       while 1:
>               sys.stderr.write("hello\n")
>               sys.stderr.flush()
>               time.sleep(1)
>
>
>
> Im dont use win32 usually.. im lost in the Gates dimension :).
>
>
> _------------------------------------------------------------.
> | Nahuel Greco                 Web Development - Open Source |
> | http://www.codelarvs.com.ar  Game Programming - Research   |
> | Freelance coding / sysadmin  Networking. The answer is 42. |
> '------------------------------------------------------------'
>
>

_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activepython

Reply via email to