Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; ';-)': 0.03; 'paths': 0.07; 'string': 0.09; 'cursor': 0.09; 'parameter': 0.09; 'subject:extra': 0.09; 'windows,': 0.09; 'command.': 0.16; 'did.': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'igor': 0.16; 'literals': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'received:84.93': 0.16; 'received:84.93.230': 0.16; 'skip:d 60': 0.16; 'subject:variable': 0.16; 'tim,': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'example': 0.22; 'import': 0.22; 'header:User-Agent:1': 0.23; 'specify': 0.24; '15,': 0.26; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; 'am,': 0.29; 'tim': 0.29; 'dec': 0.30; 'important.': 0.30; 'code': 0.31; '>>>>': 0.31; 'chase': 0.31; 'omitted': 0.31; 'url:python': 0.33; 'beginning': 0.33; 'raw': 0.33; 'skip:s 30': 0.35; 'received:84': 0.35; 'really': 0.36; 'url:org': 0.36; 'thank': 0.38; 'url:library': 0.38; 'to:addr:python-list': 0.38; 'subject:" ': 0.39; 'to:addr:python.org': 0.39; 'you.': 0.62; 'header:Reply- To:1': 0.67; 'reply-to:no real name:2**0': 0.71; '4:29': 0.84; 'or:': 0.84; 'reply-to:addr:python.org': 0.84; 'crucial': 0.91; '2013': 0.98 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=IvYnLtPg c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=0Bzu9jTXAAAA:8 a=baqLi5_GPZIA:10 a=ihvODaAuJD4A:10 a=OUOv7kDek9cA:10 a=8nJEP1OIZ-IA:10 a=EBOSESyhAAAA:8 a=8AHkEIZyAAAA:8 a=FiLmTzxtswQA:10 a=8uR6FKqcAAAA:8 a=qqTJ19oy0k_nPio9Y2EA:9 a=wPNLvfGTeEIA:10 a=T4ansrN6Ej0A:10 X-AUTH: mrabarnett:2500 Date: Mon, 16 Dec 2013 00:58:31 +0000 From: MRAB User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Eliminate "extra" variable References: <52A25D94.9040404@islandtraining.com> <20131208125823.241112db@bigbox.christie.dr> <20131208161858.1365f2d7@bigbox.christie.dr> <20131215061720.2fbb394d@bigbox.christie.dr> <20131215062923.184bf636@bigbox.christie.dr> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: python-list@python.org 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: 41 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1387155512 news.xs4all.nl 2921 [2001:888:2000:d::a6]:58918 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:61975 On 15/12/2013 22:46, Igor Korot wrote: > Tim, > > On Sun, Dec 15, 2013 at 4:29 AM, Tim Chase > wrote: >> On 2013-12-15 06:17, Tim Chase wrote: >>>>>>>> conn = sqlite3.connect('x.sqlite', >>>>>... detect_types=sqlite3.PARSE_DECLTYPES|sqlite3.PARSE_COLNAMES) >>> >>> Your example code omitted this one crucial line. Do you specify the >>> detect_types parameter to connect()? > > Yes, I did. > This is the beginning of the session: > >>>> import sqlite3 >>>> conn = sqlite3.connect('c:\Documents and Settings\Igor.FORDANWORK\Desktop\mydb.db', detect_types = sqlite3.PARSE_DECLTYPES|sqlite3.PARSE_COLNAMES) > When writing paths on Windows, it's a good idea to use raw string literals or slashes instead of backslashes: conn = sqlite3.connect(r'c:\Documents and Settings\Igor.FORDANWORK\Desktop\mydb.db', detect_types = sqlite3.PARSE_DECLTYPES|sqlite3.PARSE_COLNAMES) or: conn = sqlite3.connect('c:/Documents and Settings/Igor.FORDANWORK/Desktop/mydb.db', detect_types = sqlite3.PARSE_DECLTYPES|sqlite3.PARSE_COLNAMES) > Also please note that you session was missing the cursor creation command. ;-) > > Thank you. > >> >> It's really the PARSE_DECLTYPES that is important. >> >> http://docs.python.org/2/library/sqlite3.html#sqlite3.PARSE_DECLTYPES >>