automating command line program

Victor Chen vchen at meetingmaker.com
Fri Jul 12 11:55:26 EDT 2002


More specifically, I'm trying to automate testing for a command line program. I've successfully launched the program and now the program is prompting me for some information. However, I'm not able to tell python to input the information which I would like to enter. I've tried os.popen, and os.system, but they will not input information into the program, instead, they will run after i break out from the program and tries to input the information into the windows command prompt in which will result in an windows command prompt error because the information is not recognized as a valid command. If I don't break from the program, then I will be at a halt because the program just keeps on waiting for input of the information and will not exit itself.

Further, I've looked up a module called the Expect module for python. Sometimes called Expectpy or expy but am unable to find a windows version of it.

I will look into popen2. Thank you.
Victor 

"Cameron Laird" <claird at starbase.neosoft.com> wrote in message news:200207121609.LAA06741 at starbase.neosoft.com...
> In article <mailman.1026485483.24587.python-list at python.org>,
> Mark McEahern <marklists at mceahern.com> wrote:
> ><quote>I'm fairly new to python and I've been trying to automate the usage
> >of a command line prompt program and I'm able to successfully run the
> >application from command line but once the program has launched, I'm unable
> >to enter anymore commands into the program. I've basically just tried using
> >os.system, os.popen, and print statements. Is there other python commands
> >that will allow me to do this? I've looked around the web and I've found a
> >module, Expect, that may be able to help me but I'm unable to find a windows
> >version of this module for python. Any help is appreciated, thank you.
> >Victor</quote>
> >
> >Could you please be more specific?  What is it you're trying to do?  What
> >specifically have you tried?  What specifically isn't working?
> .
> .
> .
> Myself, I thought he made it clear enough.  He's made
> some progress with os.popen; now he needs to be told
> about os.popen2 (and possibly os.popen3--my guess is
> that's unlikely, though).
> 
> Victor, look those up in whatever documentation you're
> using.  I suspect you'll find they give you everything
> you're after.
> 
> Are there any warnings about popen2 under Windows Victor
> should hear?
> -- 
> 
> Cameron Laird <Cameron at Lairds.com>
> Business:  http://www.Phaseit.net
> Personal:  http://starbase.neosoft.com/~claird/home.html
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20020712/31922256/attachment.html>


More information about the Python-list mailing list