Hi!

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...

os.system(aCommand)
os.system(anotherCommand)

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

/Sason

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 article has been dead for over six months. Start a new discussion instead.