Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #61993
| References | (12 earlier) <CA+FnnTz-T8S3Z-Qaa7T_mHke-1+XN8-iZifnhBoS+aWQhje46A@mail.gmail.com> <20131215061720.2fbb394d@bigbox.christie.dr> <20131215062923.184bf636@bigbox.christie.dr> <CA+FnnTyuvD2sMdYaQYt39vH_BE-a9o3rLSJ3stmXzNiFEQqcoA@mail.gmail.com> <52AE5037.5000300@mrabarnett.plus.com> |
|---|---|
| Date | 2013-12-15 20:24 -0800 |
| Subject | Re: Eliminate "extra" variable |
| From | Igor Korot <ikorot01@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.4171.1387167868.18130.python-list@python.org> (permalink) |
Hi,
I have the same result even with:
sqlite3.connect(r'...')
Any other alternatives?
Thank you.
On Sun, Dec 15, 2013 at 4:58 PM, MRAB <python@mrabarnett.plus.com> wrote:
> On 15/12/2013 22:46, Igor Korot wrote:
>>
>> Tim,
>>
>> On Sun, Dec 15, 2013 at 4:29 AM, Tim Chase
>> <python.list@tim.thechases.com> 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
>>>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: Eliminate "extra" variable Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-08 19:10 +0000
Re: Eliminate "extra" variable Roy Smith <roy@panix.com> - 2013-12-08 15:07 -0500
Fwd: Eliminate "extra" variable Igor Korot <ikorot01@gmail.com> - 2013-12-08 12:58 -0800
Re: Eliminate "extra" variable Tim Chase <python.list@tim.thechases.com> - 2013-12-08 16:18 -0600
Re: Fwd: Eliminate "extra" variable Dave Angel <davea@davea.name> - 2013-12-08 17:36 -0500
Re: Eliminate "extra" variable Igor Korot <ikorot01@gmail.com> - 2013-12-14 23:49 -0800
Re: Eliminate "extra" variable Tim Chase <python.list@tim.thechases.com> - 2013-12-15 06:17 -0600
Re: Eliminate "extra" variable Tim Chase <python.list@tim.thechases.com> - 2013-12-15 06:29 -0600
Re: Eliminate "extra" variable Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-12-15 12:08 -0500
Re: Eliminate "extra" variable Igor Korot <ikorot01@gmail.com> - 2013-12-15 14:46 -0800
Re: Eliminate "extra" variable MRAB <python@mrabarnett.plus.com> - 2013-12-16 00:58 +0000
Re: Eliminate "extra" variable Igor Korot <ikorot01@gmail.com> - 2013-12-15 18:43 -0800
Re: Eliminate "extra" variable Dave Angel <davea@davea.name> - 2013-12-15 21:58 -0500
Re: Eliminate "extra" variable Chris Angelico <rosuav@gmail.com> - 2013-12-16 13:57 +1100
Re: Eliminate "extra" variable Igor Korot <ikorot01@gmail.com> - 2013-12-15 20:24 -0800
csiph-web