Opening and Reading Files
Open text files and read their contents with read and readlines.
Introduction
Python's built-in open() function gives you access to the filesystem. Reading files line by line is memory-efficient for large data.
open() Basics
f = open('file.txt', 'r') opens in read mode. Modes: 'r' read, 'w' write, 'a' append, 'b' binary.
# f = open('data.txt', 'r')
# content = f.read()
# f.close()
print('open demo')