why not use pexpect, it has worked great for me in the past.
+1 for pexpect. it is very handy to automate user inputs
Re:Sh.py
by subhobroto on Sunday September 16, 2012 @09:47PM
(#4531026)
+1, and this can be complimentary to fabric like scripts too to make pretty powerful scripts!
Shameless plug, I wrote an `expect` replacement utility in Node.js: https://github.com/jprichardson/node-suppose
http://amoffat.github.com/sh/index.html#interactive-callback...
Lets you replace `expect` with Python code pretty darn easily.