I am trying to telnet to a machine and execute some commands over there and will come back to the terminal (the place where i am actually running the python script). After executing few lines of code i need to go back to the tel-netted process and verify few things.
I am not sure how to do that. previously I used to work on TCL where we could use the spawn id and send the command to the process.
Can someone help me on how to go back to the tel-netted process using its process id in python?
ip address = "127.0.0.1 8000"
username = "root"
password = "admin123"
telnet_id = pexpect.spawn("telnet " + ipaddress)
telnet_id.expect(":")
when I print telnet_id
it gives
exitstatus: None
flag_eof: False
pid: 17398
child_fd: 3
closed: False
timeout: 30
delimiter: <class 'pexpect.EOF'>
logfile: <open file '<stdout>', mode 'w' at 0x7f0581d9c150>
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None