Re: Updating a variable problem.

2020-08-04 Thread dn via Python-list
On 04/08/2020 20:38, Steve wrote: 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) # Work

Re: Updating a variable problem.

2020-08-04 Thread MRAB
On 2020-08-04 18:25, Steve wrote: How is MSN a new variable? It is not intended to be. If line 8 is commented out, it is printable in all three locations. If line 8 is not commented out, then MSN in the previous line is determined to be undeclared. It looks as if I am not allowed to change th

Re: Problems with tool tips...

2020-08-04 Thread Terry Reedy
On 8/3/2020 5:57 PM, Steve wrote: Python/IDLE How do I get rid of the "suggestion" box tool tips AFAIK, you are the first person to request this, though perhaps not the first to think it. Escape closes the box. that always blocks the work I need to see when writing code? AFAIK, the popu

RE: Updating a variable problem.

2020-08-04 Thread Steve
How is MSN a new variable? It is not intended to be. If line 8 is commented out, it is printable in all three locations. If line 8 is not commented out, then MSN in the previous line is determined to be undeclared. It looks as if I am not allowed to change the contents of the variable MSN.

Re: Updating a variable problem.

2020-08-04 Thread Souvik Dutta
Probably because the MSN variable in the second function is not global. On Tue, Aug 4, 2020, 2:08 PM Steve wrote: > 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")

Updating a variable problem.

2020-08-04 Thread Steve
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. MS