Open text file in Python

with open(“filename.txt”) as fs: for line in fs: print(line)

Know more: