<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">




<br>
Second question is more of a performance question:<br>
<br>
I don&#39;t suspect a &quot;large&quot; # of items in the to_do list, so I *think*<br>
that it would be better to just have one SQL statement and then loop<br>
through the results 10 times to get the first few records rather than<br>
having a seperate sql statement as I have shown here.  I&#39;m too new at<br>
python to have a feel for the *right* way to go about this part<br>
<br>
Could someone point me in the right direction please?<br></blockquote></div></div></div></blockquote></div><br>As to your second question, I had the same question a few days ago that the folks here helped me out with.  if you have a list of items you can limit the loop to get just the first ten items like this:<br>



<br>for x in list_of_results[:10]<br>     do something with x...<br><br>If your object does not easily lend itself to applying a slice, then look into the itertools module and the islice() method which can help you get and iterable list from a normaly non-iterable source, like this:<br>
<br>import itertools<br>
for x in itertools.islice(results, 0, 10)<br>
     do something with x...<br><br><br>-Bill<br>
<br>

<br>