You should only be seeing things like that if you've enabled debug mode on that instance of the Telnet
class.
Debug mode is off by default, so unless you've changed telnetlib.py
, there's no way you can get that output with the code block you posted in the question.
Either way, you can explicitly disable it with...
tn = telnetlib.Telnet()
tn.set_debug_level(0)
tn.open(host)
tn.write(command.encode('ascii') + b"\n")
# etc.