<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Jan 27, 2013 at 1:05 PM, Κώστας Παπαδόπουλος <span dir="ltr"><<a href="mailto:nikos.gr33k@gmail.com" target="_blank">nikos.gr33k@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Τη Κυριακή, 27 Ιανουαρίου 2013 6:12:59 μ.μ. UTC+2, ο χρήστης <a href="mailto:ru...@yahoo.com">ru...@yahoo.com</a> έγραψε:<br>
<div><div class="h5">> On 01/27/2013 02:04 AM, Ferrous Cranus wrote:<br>
><br>
> >[...]<br>
><br>
> > data = cur.fetchall()<br>
><br>
> > for row in data:<br>
><br>
> > print ( "<tr>" )<br>
><br>
> ><br>
><br>
> > for item in row:<br>
><br>
> > print( '''<td> <a href='<a href="http://www." target="_blank">http://www.</a>%s?show=log'>%s</a> </td>''' % (item, item) )<br>
><br>
> >[...]<br>
><br>
> > Okey, so far BUT i want the url linking to happen only for the URL column's<br>
><br>
> > value, and not for the hits column too. How do i apply the url link to the<br>
><br>
> > URL column's value only?<br>
><br>
><br>
><br>
> Ferrous,<br>
><br>
><br>
><br>
> 'row' has two items (the url and the hit count) in it, right?<br>
><br>
> So print each separately rather than in a loop:<br>
><br>
><br>
><br>
> data = cur.fetchall()<br>
><br>
> for row in data:<br>
><br>
> url = row[0]<br>
><br>
> hits = row[1]<br>
><br>
> print ( "<tr>" )<br>
><br>
> print( "<td> <a href='<a href="http://www." target="_blank">http://www.</a>%s?show=log'>%s</a> </td>: % (url, hits) )<br>
<br>
</div></div>Yes that can work, but i want to ask you if its possible to do the same thing from within the loop as i have it coded it until now.<br>
<br>
Is there a way to seperate the values within the loop?<br></blockquote><div><br></div><div>for row in data:<br></div><div> print( "<td> <a href='<a href="http://www." target="_blank">http://www.</a>%s?show=log'>%s</a> </td>: " % (row[0], row[1]) )</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class=""><font color="#888888">--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><div>Joel Goldstick<br></div><a href="http://joelgoldstick.com" target="_blank">http://joelgoldstick.com</a><br></div>
</div></div>