I have the following codes using pexpect in linux it is ok.
import pexpect
child = pexpect.spawn('ssh test@ip' % (susername, ip) , encoding='utf-8')
child.logfile = open("{}/{}.txt".format(folder, ip),"w")
when have tried to change to wexpect to be used in windows but the logfile is empty my goal is to write everything the wexpect spawn into a logfile from start to end
i have tried
import wexpect
logging =""
child = wexpect.spawn('ssh -c aes256-cbc %s@%s' % (username, ip) , encoding='utf-8' , logfile=logging)
print(logging)
child.logfile = open("{}/{}.txt".format(folder, ip),"w")
but print is empty as well.
All other wexpect
functions seems to be working fine, I am able to use .sendline
, .expect
function.
checking if anyone know how to get the logging to work don't seems to have many documentation on it