Loading lesson path
Concept visual
Start at both ends
Python has a set of methods available for the file object.
Returns the separated raw stream from the buffer fileno() Returns a number that represents the stream, from the operating system's perspective flush()
Returns whether the file stream is interactive or not read()
Returns whether the file stream can be read or not readline()
Returns a list of lines from the file seek()
Returns whether the file allows us to change the file position tell()
Resizes the file to a specified size writable() Returns whether the file can be written to or not write() Writes the specified string to the file writelines() Writes a list of strings to the file Learn more about the file object in our Python File Handling Tutorial.