<div><span class="gmail_quote">assume:</span></div>
<div><span class="gmail_quote">you have two list with the same size</span></div>
<div><span class="gmail_quote">L1 = [1,2,3]</span></div>
<div><span class="gmail_quote">L2 = [11,22,33]</span></div>
<div><span class="gmail_quote"></span>&nbsp;</div>
<div><span class="gmail_quote">you can zip the L1 and L2 into L</span></div>
<div><span class="gmail_quote">L =&nbsp;zip(L1,L2)&nbsp; # L = [(1,11),(2,22),(3,33)]&nbsp;</span></div>
<div><span class="gmail_quote"></span>&nbsp;</div>
<div><span class="gmail_quote">then you can process:</span></div>
<div><span class="gmail_quote">for x in L:</span></div>
<div><span class="gmail_quote">&nbsp; dosomething(x[0])...</span></div>
<div><span class="gmail_quote">&nbsp; dosomething(x[1])...</span></div>
<div><span class="gmail_quote"></span>&nbsp;</div>
<div><span class="gmail_quote">I'm not so sure about your problem but</span></div>
<div><span class="gmail_quote">If you want to do something parallel processing then you should go to threading or pyro.</span></div>
<div><span class="gmail_quote"></span>&nbsp;</div>
<div><span class="gmail_quote">Cheers,</span></div><span class="sg">
<div><span class="gmail_quote">pujo</span></div></span><br><br>
<div><span class="gmail_quote">On 9/15/05, <b class="gmail_sendername">Ed Singleton</b> &lt;<a href="mailto:singletoned@gmail.com">singletoned@gmail.com</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">I roughly want to be able to do:<br><br>for f, x in bunch_of_files, range(z):<br><br>so that x iterates through my files, and y iterates through something else.
<br><br>Is this something I can do?<br><br>If so, what would be the best way to create a range of indeterminate length?<br><br>If not, is there a nice way I can do it, rather than than incrementing<br>a variable (x = x + 1) every loop?
<br><br>Or maybe can I access the number of times the loop has run?&nbsp;&nbsp;('x = x +<br>1' is so common there must be some more attractive shortcut).<br><br>So far in learning Python I've founbd that when I feel you should be<br>
able to do something, then you can.&nbsp;&nbsp;This seems a pretty intuitive<br>thing to want to do, so I'm sure it must be possible, but I can't find<br>anything on it.<br><br>Many thanks<br><br>Ed<br>_______________________________________________
<br>Tutor maillist&nbsp;&nbsp;-&nbsp;&nbsp;<a href="mailto:Tutor@python.org">Tutor@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/tutor">http://mail.python.org/mailman/listinfo/tutor</a><br></blockquote></div><br>