Text files with line iteration
Ascii_stream instances can be used like normal read-only file objects
(i.e. by calling readline() and readlines()), but can
also be used as sequences of lines in for-loops.
Finally, ascii_stream objects accept file names that start with '~' or
'~user' to indicate a home directory(for reading only).
Constructor: ascii_stream(|fileobject|, |lines|,|comment|),
where |fileobject| is either an open python file object or
the name of the file, |lines| is a sequence of integers
or tuples(indicating ranges) of lines to be read, |comment| is the
comment line identifier
Method summary
Methods
- __del__(self)
- __getitem__(self, item)
- __init__(self, fileobject, lines = default, comment = '#', linesep = """
""")
- close(self)
- flush(self)
- readlines(self, sizehint)
- readnextline(self)