Error in small code
Terry Reedy
tjreedy at udel.edu
Thu Jun 3 13:05:47 EDT 2004
<bubu_python at ibest.com.br> wrote in message
news:200406030454.i534sbQ10955 at mailweb05.ibest.com.br...
> def cell_click(event):
> if (event.widget["text"] == " "):
> if (pturn == 1):
> event.widget["text"] = marks[1]
> pturn = 0
> else:
> event.widget["text"] = marks[0]
> pturn = 1
As the ref manual says someplace, a variable potentially assigned a value
(ie, it is the target of an assignment statement) *anywhere* in a function
is local unless declared global. Function compilation is two pass: 1)
categorize names; 2) generate byte code.
Terry J. Reedy
More information about the Python-list
mailing list