Category: File I/O tags: FileIo Read a File Line by Line Iterate a text file lazily with a context manager. Author: chris // Language: Python Download Print Copy Code Share with open('data.txt', encoding='utf-8') as f: for line in f: print(line.rstrip())