PDA

View Full Version : Python + cmd/bash script question



flyingsliverfin
September 6th, 2012, 07:51 PM
I'm trying to figure out how to get python to run a script (in either windows cmd or ubuntu bash), and then enter some things into the prompts. I can get python to run the scripts easily, but I don't know how to pipe input into the program once they are running...

Not sure if that's very clear, let me know if you need futher clarifications

thanks

steeldriver
September 6th, 2012, 08:36 PM
I've never tried it but there's an 'expect' module you could try

http://pypi.python.org/pypi/pexpect/

flyingsliverfin
September 8th, 2012, 03:48 AM
that looks great thanks!