1#Read files with loop
2#Replace (File path) with your text file's path
3file = open("(File path)", "r")
4
5text = ""
6
7for line in file:
8 text = "%s\n%s"%(text, line)
9
10print(text)
1def file_reader(file):
2 with open(file,'r') as infile:
3 table = [row for row in infile]
4 return table
5print(file_reader('file.txt'))