0

So i have this code:

proc = subprocess.Popen("python path/to/program.py" , stdout=subprocess.PIPE)
print proc.stdout.read()

But the program i'm trying to execute requires user input like:

Press Enter to continue...

and

Would you like to do this?
(Y)es/(N)O:

When you try to run program.py in the script above, it can't put in values, and the command aborts.

Is there a way to bypass this?

David
  • 49
  • 7
  • Why don't you `import` from `program.py` and use its functionality more directly? – jonrsharpe Nov 20 '16 at 20:18
  • @jonrsharpe The program is a command line only script, and would need a lot of modifying and tweaking. I'd rather first know if there would be an other way – David Nov 20 '16 at 20:21

0 Answers0