Re: Direct interaction with subprocess - the curse of blocking I/O

2009-07-03 Thread yam850
On 3 Jul., 17:43, Scott David Daniels wrote: > yam850 wrote: > > I made a python method/function for nonblockingread from a file > > object I am happy to see comments. > OK, here's a fairly careful set of comments with a few caveats: [snip] valuable comments > --Scott David Daniels > scott.d

Re: Direct interaction with subprocess - the curse of blocking I/O

2009-07-03 Thread Scott David Daniels
yam850 wrote: I made a python method/function for non blocking read from a file object I am happy to see comments. OK, here's a fairly careful set of comments with a few caveats: Does this work on windows? The top comment should say where you know it works. Does this code correctly read

Re: Direct interaction with subprocess - the curse of blocking I/O

2009-07-03 Thread yam850
On 1 Jul., 21:30, spillz wrote: > On Jun 29, 3:15 pm, Pascal Chambon wrote: > > I've had real issues with subprocesses recently : from a python script, > > on windows, I wanted to "give control" to a command line utility, i.e > > forward user in put to it and display its output on console. It see

Re: Direct interaction with subprocess - the curse of blocking I/O

2009-07-02 Thread Pascal Chambon
Thank you all for the comments you might want something like Expect. Yes "Expect" deals with such things, unfortunately it's posix only (due to the PTY module requirement...); whereas I'd like to find generic ways (i.e at least windows/linux/mac recipes) The latter is inherently tricky (wh

Re: Direct interaction with subprocess - the curse of blocking I/O

2009-07-01 Thread ryles
On Jun 29, 5:43 pm, Scott David Daniels wrote: > and I personally wouldn't have it any other way. Simulating a shell > with hooks on its I/O should be so complicated that a "script kiddie" > has trouble writing a Trojan. +1 QOTW -- http://mail.python.org/mailman/listinfo/python-list

Re: Direct interaction with subprocess - the curse of blocking I/O

2009-07-01 Thread spillz
On Jun 29, 3:15 pm, Pascal Chambon wrote: > Hello everyone > > I've had real issues with subprocesses recently : from a python script, > on windows, I wanted to "give control" to a command line utility, i.e > forward user in put to it and display its output on console. It seems > simple, but I ran

Re: Direct interaction with subprocess - the curse of blocking I/O

2009-07-01 Thread Lawrence D'Oliveiro
In message , ryles wrote: > On Jun 29, 5:43 pm, Scott David Daniels wrote: > >>and I personally wouldn't have it any other way. Simulating a shell >> with hooks on its I/O should be so complicated that a "script kiddie" >> has trouble writing a Trojan. > > +1 QOTW Trouble is, script kiddies, b

Re: Direct interaction with subprocess - the curse of blocking I/O

2009-06-30 Thread cgoldberg
> So well, I'd like to know, do you people know any solution to this > simple problem - making a user interact directly with a subprocess? you might want something like Expect. check out the pexpect module: http://pexpect.sourceforge.net/pexpect.html -Corey -- http://mail.python.org/mailman/li

Re: Direct interaction with subprocess - the curse of blocking I/O

2009-06-29 Thread Lawrence D'Oliveiro
In message , Pascal Chambon wrote: > I met the issue : select() works only on windows ... No it doesn't. It works only on sockets on Windows, on Unix/Linux it works with all file descriptors . -- http://mail.python.org/mailman/listinfo/python-list

Re: Direct interaction with subprocess - the curse of blocking I/O

2009-06-29 Thread Scott David Daniels
Pascal Chambon wrote: I've had real issues with subprocesses recently : from a python script, on windows, I wanted to "give control" to a command line utility, i.e forward user in put to it and display its output on console Browsing the web, I found some hints : - use the advanced win32 api

Re: Direct interaction with subprocess - the curse of blocking I/O

2009-06-29 Thread Nobody
On Mon, 29 Jun 2009 21:15:52 +0200, Pascal Chambon wrote: > I've had real issues with subprocesses recently : from a python script, > on windows, I wanted to "give control" to a command line utility, i.e > forward user in put to it and display its output on console. Are you talking about a pope

Direct interaction with subprocess - the curse of blocking I/O

2009-06-29 Thread Pascal Chambon
Hello everyone I've had real issues with subprocesses recently : from a python script, on windows, I wanted to "give control" to a command line utility, i.e forward user in put to it and display its output on console. It seems simple, but I ran into walls : - subprocess.communicate() only deal