Simple sqlite3 question

Tim Roberts timr at probo.com
Thu Apr 26 08:30:10 CEST 2007


cjl <cjlesh at gmail.com> wrote:
>
>I am using python 2.5.1 on windows. I have the following code:
>
>conn = sqlite3.connect('.\optiondata')

This is unrelated to your question, but you have a slash problem there.  \o
doesn't happen to be a valid escape character, but if you had used
"testdata" as the filename, it would have failed.

You should use one of these alternatives:

 conn = sqlite3.connect('.\\optiondata')
 conn = sqlite3.connect(r'.\optiondata')
 conn = sqlite3.connect('./optiondata')
 conn = sqlite3.connect('optiondata')
-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the Python-list mailing list