Re: Class data being zapped by method



Simon Forman wrote:
(snip)
Not that this has anything to do with your actual question, but there
are a number of small details that I noticed while reading your code:


2.) Reading lines from a file is better done like so:

arrLines = open('datafiles/'+filename+'.tabdata').readlines()

Actually, it's better done like so:

fpath = os.path.join('datafiles', filename + ".tabdata")
f = open(fpath)
try:
process_opened_file(f)
finally:
f.close()

.