Package rdkit :: Package ML :: Module files :: Class ReFile
[hide private]
[frames] | no frames]

Class ReFile

source code

convenience class for dealing with files with comments

blank (all whitespace) lines, and lines beginning with comment
  characters are skipped.

anything following a comment character on a line is stripped off

Instance Methods [hide private]
 
readline(self)
read the next line and return it.
source code
 
readlines(self)
return a list of all the lines left in the file
source code
 
rewind(self)
rewinds the file (seeks to the beginning)
source code
 
__init__(self, fileName, mode='r', comment='#', trailer='\\n') source code
Method Details [hide private]

readline(self)

source code 
read the next line and return it.

return '' on EOF

readlines(self)

source code 
return a list of all the lines left in the file

return [] if there are none