Re: Python Subprocess module

2007-07-21 Thread Dave Sampson
> You probably > mean:http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440554 > > Why is that not sufficient? It will allow interaction with a called > subprocess, in a cross-platform manner, etc. > > - Josiah Sorry maybe 'not sufficient' was the wrong excuse. Maybe the right thing to

Re: Python Subprocess module

2007-07-21 Thread Dave Sampson
Thanks for your response. It;s good to see you're promtoing Pexpect. I was actualy wokring on a project at work that could have used Pexpect to automate the creation of maps by tieing togethr a bunch of processes through SSH and Pexpect looked like the money shot. however it was enough of a battle

Re: Python Subprocess module

2007-07-21 Thread Dave Sampson
send keys for the p.c. you can use a try: except: concept and on the > windows platform there is also a way to use autoit in python using > pywin. thanks for the uggestion about sendkeys. I might be able to build that into the wrapper. So you're sugesting: NIX = Pexpect WINDOZE = sendkeys Cor

Re: Python Subprocess module

2007-07-21 Thread Dave Sampson
On Jul 13, 7:50 pm, Dan Stromberg - Datallegro <[EMAIL PROTECTED]> wrote: > You could start up a pty and do your own Pexpect-like thing, using > read/readline/write. > > However, this may not be portable to windows. Maybe if you get the python > that comes with cygwin, or build your own python und

Re: Python Subprocess module

2007-07-15 Thread Josiah Carlson
Dave Sampson wrote: > I am supposed to be able to entre 'y' and return for the program to > continue if I agree with what I see in the stdout. > > A problem exists though that I have tried > 'y' > 'y\n' > 'y\r' Depending on the platform, you may need to send '\r\n'. > ASPN Python cookbok provi

Re: Python Subprocess module

2007-07-15 Thread Noah
On Jul 13, 2:15 pm, Dave Sampson <[EMAIL PROTECTED]> wrote: > hey folks, > > A simple question hopefully. despite all my searching I have not found a > satisfactory response. > > The goal. Interact with a command line program. Simple enough, but the > key is INTERACT. You need Pexpect. > So then

Re: Python Subprocess module

2007-07-13 Thread [EMAIL PROTECTED]
On Jul 13, 4:15 pm, Dave Sampson <[EMAIL PROTECTED]> wrote: > hey folks, > > A simple question hopefully. despite all my searching I have not found a > satisfactory response. > > The goal. Interact with a command line program. Simple enough, but the > key is INTERACT. > > I tried the shell and coma

Re: Python Subprocess module

2007-07-13 Thread Dan Stromberg - Datallegro
You could start up a pty and do your own Pexpect-like thing, using read/readline/write. However, this may not be portable to windows. Maybe if you get the python that comes with cygwin, or build your own python under the cygwin environment - that might be more likely to get you pty's under windo