Inserting-embedding some html data at the end of a .py file

Νίκος Γκρ33κ nikos.gr33k at
Thu Mar 7 07:42:05 CET 2013

The whole try stement is as follows to have the compete idea:

		cur.execute( '''SELECT url, hits FROM counters ORDER BY hits DESC''' )

		data = cur.fetchall()
		for row in data:
			(url, hits) = row
			print( "<tr><td><center><a href=''><font color=tomato size=5> %s </a></td>" ) % (url, url)
			print( "<td><center><font color=cyan size=5> %s </a></td></tr>" ) % (hits)
	except MySQLdb.Error, e:
		print( "Query Error: ", sys.exc_info()[1].excepinfo()[2] )

More information about the Python-list mailing list