Home | Trees | Indices | Help |
---|
|
object --+ | BufferedFile
Reusable base class to implement python-style file buffering around a simpler stream.
Instance Methods | |||
|
|||
|
|||
iterator |
|
||
|
|||
|
|||
str |
|
||
str |
|
||
str |
|
||
list |
|
||
|
|||
int |
|
||
|
|||
|
|||
iterator |
|
||
Inherited from |
Class Variables | |
FLAG_APPEND = 4
|
|
FLAG_BINARY = 16
|
|
FLAG_BUFFERED = 32
|
|
FLAG_LINE_BUFFERED = 64
|
|
FLAG_READ = 1
|
|
FLAG_UNIVERSAL_NEWLINE = 128
|
|
FLAG_WRITE = 2
|
|
SEEK_CUR = 1
|
|
SEEK_END = 2
|
|
SEEK_SET = 0
|
Properties | |
Inherited from |
Method Details |
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
|
Returns an iterator that can be used to iterate over the lines in this file. This iterator happens to return the file itself, since a file is its own iterator.
|
Close the file. Future read and write operations will fail. |
Write out any data in the write buffer. This may do nothing if write buffering is not turned on. |
Returns the next line from the input, or raises
|
Read at most
|
Read one entire line from the file. A trailing newline character is kept in the string (but may be absent when a file ends with an incomplete line). If the size argument is present and non-negative, it is a maximum byte count (including the trailing newline) and an incomplete line may be returned. An empty string is returned only when EOF is encountered immediately.
Note:
Unlike stdio's |
Read all remaining lines using readline and return them as a list. If the optional
|
Set the file's current position, like stdio's
Note:
If a file is opened in append mode ( |
Return the file's current position. This may not be accurate or useful if the underlying file doesn't support random access, or was opened in append mode.
|
Write data to the file. If write buffering is on
(
|
Write a sequence of strings to the file. The sequence can be any
iterable object producing strings, typically a list of strings. (The
name is intended to match readlines;
|
Identical to
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Sun Jul 6 18:30:28 2008 | http://epydoc.sourceforge.net |