I've been trying to run this command to ssh from a .py on a Windows platform:
child = winpexpect.spawn('ssh %s@%s' % ('myID','m.y.i.p'))
It should function similarly to pexpect, but I receive this error:
pexpect.ExceptionPexpect: The command was not found or was not executable: ssh.
I've confirmed that C:\rhcygwin\bin is in my Path. Any suggestions on how to instruct the .py file to locate the ssh command?
edit: I switched my approach: ran this code in my .py
command = ['bash', '-c', './myssh.sh']
proc = subprocess.Popen(command, stdout = subprocess.PIPE)
it's very rudimentary but it will connect successfully.