| |
- io.LineReader.LineReader
class LineReader |
|
A line reader supports the name attribute and readline() function of a
file object but none of the others. Its job is to keep track of line
numbers in the file object.
Public Variables:
/name/::
Name of the file. |
|
Methods defined here:
- __init__(self, file, lineNum=1, name=None)
- Constructs a new LineReader from a file object. If /lineNum/
is specified, it should be the initial line number.
- close(self)
- Closes the LineReader and its associated file.
- getLineNumber(self)
- Returns the current line number of the file. This is also
supported as *lineNumber()* for backwards compatibility.
- lineNumber = getLineNumber(self)
- readline(self)
- Reads and returns the next line from the file.
| |