how code a function similar to itertools.product in python 2.5
<p>I have a list of tuples, e.g: </p>

<pre><code>A=[(1,2,3), (3,5,7,9), (7)]
</code></pre>

<p>and want to generate all permutations with one item from each tuple.</p>

<pre><code>1,3,7
1,5,7
1,7,7
...
3,9,7
</code></pre>

<p>I can have any number of tuples and a tuple can have any number of elements.
And I can't use <code>itertools.product()</code> because python 2.5.</p>
