Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; ';-)': 0.03; 'mrab': 0.05; 'paths': 0.07; 'string': 0.09; 'cursor': 0.09; 'parameter': 0.09; 'subject:extra': 0.09; 'windows,': 0.09; "'/'": 0.16; 'command.': 0.16; 'did.': 0.16; 'igor': 0.16; 'literals': 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; 'replace': 0.24; '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; 'message-id:@mail.gmail.com': 0.30; 'url:mailman': 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; 'convert': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'really': 0.36; 'url:listinfo': 0.36; 'hi,': 0.36; 'url:org': 0.36; 'so,': 0.37; 'thank': 0.38; 'url:library': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'subject:" ': 0.39; 'to:addr:python.org': 0.39; 'url:mail': 0.40; 'how': 0.40; 'you.': 0.62; 'realized': 0.68; '4:29': 0.84; 'or:': 0.84; 'those?': 0.84; 'crucial': 0.91; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=dO73TnHVibT8atqOw/uzQ9aOOznXGgPp/BjRjYDEgCE=; b=tvCHVMmYQig7g1cgsfc7F8O1JJXqLFrBL8/sEql8M9zO2m0xDdm17MWgyFb7jPyWb1 C0HWJgYqTMcqk0mszqw1m3AWxYw6y8/FXRrP1fpqAOcneHcu4icqBBcUF8+vQX6Cdnz3 OmgM6qHDWBrFWlwtJta9PywtxplMzIYDw6rwiqN2qfEaKX9sykHXy+4MvuM3TTpMxz3x Az2nEfM6Hni4obYCwPffuT1rgEbsRKejvma5HPtNtLl7oPryhw+0O77DGdlQSv4nKlaf /pcx6D/Lgae25OFlFZuTMQ23e0brS02IOfidrflYDtZE39s72I0tOMN/HVu6P8RXvisk jNCA== MIME-Version: 1.0 X-Received: by 10.58.46.77 with SMTP id t13mr2832886vem.32.1387161833410; Sun, 15 Dec 2013 18:43:53 -0800 (PST) In-Reply-To: <52AE5037.5000300@mrabarnett.plus.com> 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> <52AE5037.5000300@mrabarnett.plus.com> Date: Sun, 15 Dec 2013 18:43:53 -0800 Subject: Re: Eliminate "extra" variable From: Igor Korot To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 64 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1387161841 news.xs4all.nl 2855 [2001:888:2000:d::a6]:59892 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:61985 Hi, On Sun, Dec 15, 2013 at 4:58 PM, MRAB wrote: > 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) So, how do I convert my string to one of those? I realized I can just do replace '/' to '\', but is there a better alternative? Thank you. > > >> 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 >>> > > -- > https://mail.python.org/mailman/listinfo/python-list