File Handling Problems Python I/O

Josh JoshuaACohen at gmail.com
Thu Jan 6 13:00:02 EST 2005


He is the function where I am making the call. If I change the open
statment to another file, say "c:\test.txt", a file I know exists, it
will error out stating the file does not exist. Thanks

Josh

def GetStartVars(self):
try:
DOWNFILE = open("c:\fixes.txt","r")
except IOError:
print "Failed to open file."
else:
counter = 1
while 1:
theline = DOWNFILE.readline()
if not theline:
break
print theline
counter = counter + 1
print counter
            DOWNFILE.close()




More information about the Python-list mailing list