Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def read_file_line_by_line(file_path):
- with open(file_path, 'r') as file:
- for line in file:
- yield line.strip()
- # Example
- for line in read_file_line_by_line('large_file.txt'):
- print(line)
Advertisement
Add Comment
Please, Sign In to add comment