I want to make a python program that runs different simple command line scripts. Right now I use os.system which works fine for running the scripts, but the problem is that the scripts sometimes halt and wait for input from the user. So my question is, how do i programmatically detect when an input has to be made, and then make that input instead of me having to make it manually?

my code like something like this...


aCommand and antoherCommand might stop and wait for user input which i want to make programmatically.


7 Years
Discussion Span
Last Post by Gribouillis

That seems to be exactly what I need, but it doesn't work on windows? I get a message that a critical system was not found...blabla... I also tried with cygwin, didn't work. I followed the install instructions on the website btw. The site mentiones that it doesn't work on windows but that it might work with cygwin, but no luck here.

Any suggestions? I should maybe take a look at popen. Do you know of any examples with popen that does what I want to do? I googled that earlier and couldn't find any.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.