I have a list in a file, looks like this
c4a24534,2434b375,e750c718, ....
I have split at \",\" and brought the below list.
x
#!/usr/bin/python import ast file = open("file.txt","r") i = list() q = list() for line in file: testarray = ast.literal_eval(line) q.append(testarray.pop()) i.append(testarray.pop()) print(i) print(q)
something like that ?