TypeError: unsupported operand type(s) for %: 'NoneType' and 'tuple'

Νίκος Γκρ33κ nikos.gr33k at gmail.com
Sun May 26 04:08:39 EDT 2013


Hello this is the following snippet that is causing me the error i mention in the Subject:


	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&page=%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 pymysql.ProgrammingError as e:
		print( repr(e) )


you can slso see it at:

http://superhost.gr/?show=stats



More information about the Python-list mailing list