Help! Cannot open a file in a class
Terry Reedy
tjreedy at udel.edu
Tue Mar 4 08:21:57 EST 2003
"ouj" <ouj at aludra.usc.edu> wrote in message
news:Pine.GSO.4.33.0303032040470.20130-100000 at aludra.usc.edu...
> class Cvdoc:
> def __init__(self):
> ......
> fd = file('vdoc.dat', 'wr')
> print dir(fd)
> fd.readlines()
The 'wr' problem was already pointed out, but don't you want to keep
the data you read with something like 'self.doc=fd.readlines()'?
TJR
More information about the Python-list
mailing list