name error
Benjamin Derstine
bend at realeducation.com
Mon May 3 20:40:11 EDT 1999
Hi, I'm getting a name error when I attempt the following:
f=open('/WINNT/Profiles/bend/Desktop/licensing/aud.txt','r')
f.readline()
line=f.readline()
test=line[0]
location=line[0]
def makeuser():
mastlist=[]
while test==location:
list=f.readline()
location=list[0]
mastlist.append(list)
makeuser()
error:
File "C:\WINNT\Profiles\bend\Desktop\licensing\loadtest.py", line 16, in
makeuser
while test==location:
NameError: location
It seems like I'm having a name space problem but there is nothing different
between the test and the location variables when it comes to namespace. Yet
one works and the other doesn't. Anything I'm doing wrong?
Thanks
Ben
More information about the Python-list
mailing list