Hi I am new to telnet package in python. My code works but not expected execution output contains extra alphanumerics. Final output should contain only 1.index and 2.comment. instead it prints:- f085467678G1.uGpindex_gvA3e5JGyhjejkn 9jhf2.syGtcomment_Gphjsyfufdfm. I am totally clueless
*code:**
import getpass
import telnetlib
import pyte
HOST = "http://localhost:8000/"
user = input("Enter your remote account: ")
password = getpass.getpass()
choice=[{'91':b"choice: "},{"90":b"choice: "}]
screen=pyte.Screen(80,24)
scIndex=1
def show1():
global screen
global scIndex
for i,line in enumerate(screen.show1,1):
print(line)
screen.show1.clear()
stream=pyte.Stream(screen)
tn = telnetlib.Telnet(HOST)
a=tn.read_until(b"login: ")
stream.feed(a).decode("ISO-8856-1")
show1()
tn.write(user.encode("ISO-8856-1") + b"\n")
if password:
b=tn.read_until(b"Password: ")
stream.feed(b).decode("ISO-8856-1")
show1()
tn.write(password.encode("ISO-8856-1") + b"\n")
for cm in choice:
for c in cm:
tn.write(c.encode("ISO-8856-1")+b"\n")
s=tn.read_until(cm[c])
j=s.decode("ISO-8856-1")
stream.feed(j)
show1()