'Return of telnet command in telnetlib

I'm running the command:

tn = telnetlib.Telnet(HOST, PORT)

tn.write(b'LOGIN:::CTAG::UN=admin,PWD=admin;')

tn.write(b'LST-UNREGONU::OLTID=10.0.8.220:CTAG::;')

How can I save the command return in a variable?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source