Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

automating command line program

4 views
Skip to first unread message

Victor Chen

unread,
Jul 12, 2002, 10:39:13 AM7/12/02
to
Hi,
 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

Mark McEahern

unread,
Jul 12, 2002, 10:49:05 AM7/12/02
to
<quote>I'm fairly new to python and I've been trying to automate the usage
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?

// m

-

Cameron Laird

unread,
Jul 12, 2002, 12:09:35 PM7/12/02
to
In article <mailman.1026485483...@python.org>,
.
.
.
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 <Cam...@Lairds.com>
Business: http://www.Phaseit.net
Personal: http://starbase.neosoft.com/~claird/home.html

Victor Chen

unread,
Jul 12, 2002, 11:55:26 AM7/12/02
to
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 
 
0 new messages