How to add a current string into an already existing list
antoon.pardon at rece.vub.ac.be
Tue Nov 5 13:42:19 CET 2013
Op 05-11-13 13:25, Nick the Gr33k schreef:
> # fetch those columns that act as lists but are stored as strings
> cur.execute('''SELECT refs, visits, downloads FROM visitors WHERE
> counterID = %s and host = %s''', (cID, host) )
> data = cur.fetchone()
> print( type(data) )
> i tried inserting a type function to notify me of the datatype of 'data'
> but that didnt help too.
> [Tue Nov 05 14:22:32 2013] [error] [client 184.108.40.206] File
> "/home/nikos/public_html/cgi-bin/metrites.py", line 268, in <module>
> [Tue Nov 05 14:22:32 2013] [error] [client 220.127.116.11] (ref,
> visit, download) = data
> [Tue Nov 05 14:22:32 2013] [error] [client 18.104.22.168] TypeError:
> 'NoneType' object is not iterable
> Unfortunately i still miss your point.
*Read* the documentation of fetchone! The information you need is there.
More information about the Python-list