readlines() doesn't read entire file

Jeremy jlconlin at lanl.gov
Thu Jul 14 19:14:24 EDT 2005


I have a most aggravating problem.  I don't understand what is causing 
readlines() not to read all the lines in the file.  I have the following 
syntax:



# some initial stuff
XS = xsdir(Datapath + '/xsdir', options.debug)
# some more stuff

class xsdir(object):    #{{{1
     """This class handles all of the data and methods for reading
     the xsdir file."""

     def __init__(self, Datapath, debug=False):
         self.xsdir = file(Datapath, 'r')        # File object
         self.lines = self.xsdir.readlines()
         if debug:
             print self.lines
	# and then other stuff as well


I can see all the lines in the list self.lines, but they are not all the 
lines in the file.  When I look at the file in Vim, I can see all the 
lines, but Python cannot.  Can someone help me with this one?
Thanks,
Jeremy




More information about the Python-list mailing list