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

Νίκος Γκρ33κ nikos.gr33k at gmail.com
Thu Mar 7 01:42:05 EST 2013


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

	try:
		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='http://superhost.gr/?show=log&htmlpage=%s'><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