I need to script/automate an interactive terminal client using Python. The client accepts three arguments and runs as follows:
>./myclient <arg1> <arg2> <arg3>
Welcome...
blah...
blah..
[user input]
some more blah... blah... for the input entered
blah..
blah..
[basically it accepts input and puts the output in the console until the user types 'quit']
Now I need to automate this in Python and the console output saved in a file.
You probably want to use pexpect (which is a pure-python version of the venerable expect).
Something like this should be enough to solve your case. pexpect is capable of a lot more though, so read up on the documentation for more advanced use-cases.