On 09/08/2015 03:57 PM, Chris Angelico wrote:
On Tue, Sep 8, 2015 at 9:37 PM, <harirammanohar...@gmail.com> wrote:
Some where i am missing simple logic.... :)
=====
child = pexpect.spawn('ssh hari@hostname')
child.logfile = sys.stdout
child.expect('hari\'s Password: ')
=====
getting error as follows:
============
child.expect('hari\'s Password: ')
TypeError: must be str, not bytes
===========
Laura's already answered your actual question. But I would recommend
using public key login [snip]
ChrisA
My 2 cents, beside the public key, use the python module paramiko,
unless you really want to work at the low level yourself.
http://docs.paramiko.org/en/1.15/api/client.html
JM
--
https://mail.python.org/mailman/listinfo/python-list