The rest of the examples in this section will assume that a file
object called f has already been created. To read a file's
contents, call f.read(size), which reads some quantity of data
and returns it as a string. size is an optional numeric
argument. When size is omitted or negative, the entire contents
of the file will be read and returned; it's your problem if the
file is twice as large as your machine's memory. Otherwise, at
most size bytes are read and returned. If the end of the file
has been reached, f.read() will return an empty string (""). >>>
f.read() 'This is the entire file.\012' >>> f.read() ''
f.readline() reads a single line from the file; a newline
character (\n) is left at the end of the string, and is only
omitted on the last line of the file if the file doesn't end in
a newline. This makes the return value unambiguous; if
f.readline() returns an empty string, the end of the file has
been reached, while a blank line is represented by '\n', a
string containing only a single newline. >>> f.r