with as python read lines code example
Example 1: readlines from file python
f = open("file.txt", 'r')
print(f.readlines()) # array of file lines
Example 2: print file line by line python
with open('yourfile.txt','r') as f:
lines = f.readlines()
f.close()