Updating a variable problem.
Steve
Gronicus at SGA.Ninja
Tue Aug 4 04:38:31 EDT 2020
Why should line 6 fail until line 7 is commented out?
Python complains that MSN is "referenced before assignment".
def ReadTheEQfile():
global MSN
MSN = ("1 Monitor") #This line works every time.
def EditTheEQlist():
print("MSN2 = " + MSN) # Works if the next line is commented out.
MSN = ("3 Monitor")
# Main()
ReadTheEQfile()
print("MSN1 = " + MSN) # This line works every time
EditTheEQlist()
=====================================
Footnote:
Genie: You have three wishes.
Me: I wish I had more wishes.
Genie: You cannot wish for more wishes.
Me: I wish I could.
More information about the Python-list
mailing list