Using python with SSH?

eichin at metacarta.com eichin at metacarta.com
Sun Dec 21 18:51:49 EST 2003


I use python-expect for this.  Note that python-expect is not
particularly good (gets the trailing flush case wrong sometimes,
doesn't actually behave like 'sh -c' even though the documentation
claims it does) and un(der)documented, but the basic use of
expect.popen2 on a single command (such as you described) works just
fine.  It works fairly well to use this under qmtest - you put the
hostname (and perhaps password) of the machine-under-test into your
context file, then you have standard tests that build on top of a
basic "scp/ssh over to that machine, compare the results with this
regexp/string" and you can get pretty far with that.




More information about the Python-list mailing list