how to import list from file in python
<p>I have a file like <code>f = [1,1,2,2,2,3,3,4,5]</code> 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 <code>f = [1,1,1,1,1]</code> and the second contain <code>d = [2,2,2,2,2]</code> and i would like to <code>zip(i,j) for i in f and for j in d</code>.</p>

<pre><code>f = file('f.txt')
d = file('d.txt')

for i in f:
    for j in d:
        print zip(i,j)
</code></pre>

<p>The result is </p>

<pre><code>[('[', '['), ('1', '2'), (',', ','), ('1', '2'), (',', ','), ('1', '2'), (',', ','), ('1', '2'), (',', ','), ('1', '2'), (']', ']'), ('\n', '\n')]
</code></pre>

<p>and i would like to be like </p>

<pre><code>[(1,2),(1,2), (1,2),(1,2), (1,2)]
</code></pre>
