Formatting a column's value output

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


	try:
		cur.execute( '''SELECT URL, hits FROM counters ORDER BY hits DESC''' )
	except MySQLdb.Error, e:
		print ( "Query Error: ", sys.exc_info()[1].excepinfo()[2] )
	else:
		data = cur.fetchall()
		
		for row in data:
			print ( "<tr>" )
				
			for item in row:
				print ( "<td><b><font color=yellow> %s </td>" % item )
			
		sys.exit(0)
=====================================

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