0

config.py

import telnetlib

def my_function(a):
    tn=telnetlib.Telnet(a)

main.py

import config.py

HOST=172.25.25.5
config.my_function(HOST)

tn.write(b"show run".encode('ascii') + b"\n")

This code will return 'tn' is not defined. How do I gain access to the variable 'tn' after importing from config.py to main.py?

bgardne7
  • 91
  • 1
  • 11

0 Answers0