Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.012 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'received:134': 0.05; 'subject:into': 0.09; 'subject:string': 0.09; 'subject:How': 0.10; 'stored': 0.12; "'data'": 0.16; 'columns': 0.16; 'fetch': 0.16; 'inserting': 0.16; 'iterable': 0.16; 'nick': 0.16; 'subject:already': 0.16; 'sys.exit(0)': 0.16; 'typeerror:': 0.16; 'header:User-Agent:1': 0.23; 'skip:" 40': 0.26; 'header:In-Reply- To:1': 0.27; 'tried': 0.27; 'function': 0.29; 'host': 0.29; 'subject:list': 0.30; 'too.': 0.31; 'didnt': 0.31; 'file': 0.32; 'lists': 0.32; 'there.': 0.32; 'point.': 0.35; 'but': 0.35; 'nov': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'skip:u 10': 0.60; 'act': 0.63; 'information': 0.63; 'miss': 0.74; 'pardon': 0.84; 'visit,': 0.84; 'subject:add': 0.91 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqAEAOvmeFKGuA9G/2dsb2JhbABZgz+DW7wygT+DGgEFI1URCxoCBRYLAgIJAwIBAgFFEwgCh32rbYktiRSBKY43FoJVgUQDmAqBL4R6i2CDJw Date: Tue, 05 Nov 2013 13:42:19 +0100 From: Antoon Pardon User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: python-list@python.org Subject: Re: How to add a current string into an already existing list References: <5278db56$0$29972$c3e8da3$5496439d@news.astraweb.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1383655340 news.xs4all.nl 15913 [2001:888:2000:d::a6]:43060 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:58501 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) ) > sys.exit(0) > > i tried inserting a type function to notify me of the datatype of 'data' > but that didnt help too. > > Still: > [Tue Nov 05 14:22:32 2013] [error] [client 176.92.96.218] File > "/home/nikos/public_html/cgi-bin/metrites.py", line 268, in > [Tue Nov 05 14:22:32 2013] [error] [client 176.92.96.218] (ref, > visit, download) = data > [Tue Nov 05 14:22:32 2013] [error] [client 176.92.96.218] TypeError: > 'NoneType' object is not iterable > > Unfortunately i still miss your point. *Read* the documentation of fetchone! The information you need is there. -- Antoon Pardon