Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #46052

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

Newsgroups comp.lang.python
Date 2013-05-26 01:08 -0700
Message-ID <ffb99274-6844-4638-bb4b-4312c0b246c2@googlegroups.com> (permalink)
Subject TypeError: unsupported operand type(s) for %: 'NoneType' and 'tuple'
From Νίκος Γκρ33κ <nikos.gr33k@gmail.com>

Show all headers | View raw


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

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

TypeError: unsupported operand type(s) for %: 'NoneType' and 'tuple' Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-26 01:08 -0700
  Re: TypeError: unsupported operand type(s) for %: 'NoneType' and 'tuple' Peter Otten <__peter__@web.de> - 2013-05-26 10:23 +0200
    Re: TypeError: unsupported operand type(s) for %: 'NoneType' and 'tuple' Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-26 02:12 -0700
      Re: TypeError: unsupported operand type(s) for %: 'NoneType' and 'tuple' Peter Otten <__peter__@web.de> - 2013-05-26 11:25 +0200
        Re: TypeError: unsupported operand type(s) for %: 'NoneType' and 'tuple' Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-26 03:32 -0700
  Re: TypeError: unsupported operand type(s) for %: 'NoneType' and 'tuple' Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-26 06:00 -0700
    Re: TypeError: unsupported operand type(s) for %: 'NoneType' and 'tuple' Chris Angelico <rosuav@gmail.com> - 2013-05-26 23:10 +1000
      Re: TypeError: unsupported operand type(s) for %: 'NoneType' and 'tuple' nagia.retsina@gmail.com - 2013-05-26 08:00 -0700
        Re: TypeError: unsupported operand type(s) for %: 'NoneType' and 'tuple' Chris Angelico <rosuav@gmail.com> - 2013-05-27 01:24 +1000
          Re: TypeError: unsupported operand type(s) for %: 'NoneType' and 'tuple' Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-26 08:45 -0700
            Re: TypeError: unsupported operand type(s) for %: 'NoneType' and 'tuple' Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-26 09:10 -0700
              Re: TypeError: unsupported operand type(s) for %: 'NoneType' and 'tuple' Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-05-26 17:45 +0100
                Re: TypeError: unsupported operand type(s) for %: 'NoneType' and 'tuple' Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-27 23:01 -0700
        Re: TypeError: unsupported operand type(s) for %: 'NoneType' and 'tuple' Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-05-26 17:43 +0100
    RE: TypeError: unsupported operand type(s) for %: 'NoneType' and 'tuple' Carlos Nepomuceno <carlosnepomuceno@outlook.com> - 2013-05-26 17:23 +0300

csiph-web