Formatting a column's value output

Ferrous Cranus nikos.gr33k at
Sat Jan 26 18:51:32 CET 2013

		cur.execute( '''SELECT URL, hits FROM counters ORDER BY hits DESC''' )
	except MySQLdb.Error, e:
		print ( "Query Error: ", sys.exc_info()[1].excepinfo()[2] )
		data = cur.fetchall()
		for row in data:
			print ( "<tr>" )
			for item in row:
				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?

Thank you.

More information about the Python-list mailing list