Formatting a column's value output

Ferrous Cranus nikos.gr33k at gmail.com
Sat Jan 26 16:07:49 EST 2013


Τη Σάββατο, 26 Ιανουαρίου 2013 8:04:12 μ.μ. UTC+2, ο χρήστης Chris Angelico έγραψε:
> On Sun, Jan 27, 2013 at 4:51 AM, Ferrous Cranus <nikos.gr33k at gmail.com> wrote:
> 
> >                                 print ( "<td><b><font color=yellow> %s </td>" % item )
> 
> 
> 
> >
> 
> > In the aboce code wheb 'URL' is to be typed out be print i need it to be formatted as a link, so the viewer can click on it.
> 
> >
> 
> > Is this possible please?
> 
> 
> 
> Easy, just make a tuple of item,item and have two %s markers:
> 
> 
> 
> print( "<td><b><font color=yellow><a href='%s'>%s</a></td>" % (item, item) )

That code works, but it creates links for both the URL and hits columns!
Only the URL must be linked not the hits column!



More information about the Python-list mailing list