Apr-21-2020, 03:55 PM
(This post was last modified: Apr-21-2020, 03:57 PM by deanhystad.)
Without seeing all your code I cannot think of a reason why you are using main.py. Why doesn't telnet.py ask for the mac address? However, from the info provided in your last post I see no reason why your code does not work. Essentially it is the same as this.
page1.py
page1.py
value = input('Enter a value:')page2.py
import page1 print('The value is', page1.value)
Output:Enter value: 5
The value is 5
I re-read your posts more carefully this time. Upon further reflection it sounds like there is no need for telnet.py. You should write a function that does what telnet.py does. Actually you should write a function that inputs the mac address, computes the IP address, and returns the computed IP address. Your main program would call this function just like any of the standard functions. Now you only have 1 module and don't have to worry about global variables.