I usually worked with python library "telnetlib"
but i faced a problem and i don't know how to figure it out.
Here's the code:
def bbb():
tn = telnetlib.Telnet(Ip, port=23, timeout=20)
print(tn)
tn.write(bytes("Something no.1 \n", encoding='utf-8'))
time.sleep(10)
## ~~~ blah blah read data ~~~ ##
tn.mt_interact()
tn.write(bytes("Something no.2 \n", encoding='utf-8'))
tn.close()
time.sleep(1.5)
I wanna read a lot of data from telnet and any of tn.read command doensn't work.. (ex. tn.read_all())
So i need to use tn.mt_interact()
But after that line, code doesn't work and telnet connection looks like just pause so I cannot close tn connection.
SURPRISINGLY, when i run the same code at SPYDER(Anaconda), it WORKS!!! Is that possible?
And I need to make this code as a exe file
and exe file doesn't work at the same point: tn.mt_interact()