global variables and local functions.
astrophels at yahoo.com
Wed Aug 28 22:57:27 EDT 2002
Hey Guys - stumped again.
Basically here's what I'm trying to do:
list1 = 
list2 = 
global_int = 0
f = open(file)
for l in f.readline():
global_int += 1
for x in range (global_int):
this is the error I get:
File "./mf.py", line 102, in ?
File "./mf.py", line 34, in moveFiles
File "./mf.py", line 27, in populateLists
mlistLen += 1
UnboundLocalError: local variable 'mlistLen' referenced before assignment
It doesn't exactly work, which confuses me because I have global lists
that are populated by the first, and hashed by the second. Why doesn't
this work with the int type?
More information about the Python-list