I have a file like f = [1,1,2,2,2,3,3,4,5] and i would like to import this file like a list So that it is treated as a list. e.g say i have two files, one contain f = [1,1,1,1,1] and the second contain d = [2,2,2,2,2] and i would like to zip(i,j) for i in f and for j in d.
f = file('f.txt')
d = file('d.txt')
for i in f:
for j in d:
print zip(i,j)
The result is
[('[', '['), ('1', '2'), (',', ','), ('1', '2'), (',', ','), ('1', '2'), (',', ','), ('1', '2'), (',', ','), ('1', '2'), (']', ']'), ('\n', '\n')]
and i would like to be like
[(1,2),(1,2), (1,2),(1,2), (1,2)]