Code:
with open ("Test1_Votes.txt", 'r'):
f = open("Test1_Votes.txt")
lines = f.readlines()
print(lines[0])
print(lines[1])
all_lines = []
lines = lines.rstrip("\n") #does not work
for line in lines:
#in here
all_lines.append(line)
print(all_lines)
Right now it prints outputs something like: ['1,2,3,0,0\n', ...] I would like it to output [[1, 2, 3, 0, 0], ...]
File Sample:
1,2,3,0,0
1,3,2,0,0
2,3,1,0,0
3,0,1,2,0
3,0,1,0,2
The zero's must be kept in there and there is not a blank line in between each line in the .txt
Any suggestions/answers?
Thanks in advance