I want to create single Telnet object which will be used in multiple functions.
tn = (Telnet object declaration only)
def Function1(): #for connection only
tn = telnetlib.Telnet(ip)
#code
def Function2(): #to run command 1
tn.write()
def Function3(): #to run command 2
tn.write()
Function1() #Call for telnet connection
Function2() #Call to execute command 1
Function3() #call to execute command 2
What could be the solution for this?