17 Mar
2003
17 Mar
'03
8:32 p.m.
D. Rick Anderson wrote at 2003-3-15 23:21 -0800:
I've got a python script that sets a variable:
notes_eo_counter = 0
And then defines a function:
def printNotesRow(columns): .... ... This has worked just fine in several scripts, but in this particular one I'm gettin an error:
Error Type: UnboundLocalError Error Value: local variable 'notes_eo_counter' referenced before assignment
The problem is that you write to the variable: Variables from an outer scope are read automatically. However, as soon as you assign to a variable, you must declare it as from the outer scope. Please read the Python reference manual for more information. Dieter