


The file object provides you with three methods for reading text from a text file: The open() function returns a file object which you will use to read text from a text file.

F = open( 'the-zen-of-python.txt', 'r') Code language: Python ( python )

The file object provides you with three methods for reading text from a text file: The open() function returns a file object which you will use to read text from a text file.
F = open( 'the-zen-of-python.txt', 'r') Code language: Python ( python )