I have a file and its consist of multiple lists like below
[234,343,234]
[23,45,34,5]
[354,45]
[]
[334,23]
I am trying to read line by line and append to a single list in python.
how to do it?
I tried so far>
with open("pos.txt","r") as filePos:
pos_lists=filePos.read()
new_list=[]
for i in pos_lists.split("\n"):
print(type(i)) #it is str i want it as list
new_list.extend(i)
print(new_list)
thanks in advance