Re: Silly/crazy problem with sqlite

2023-11-26 Thread Chris Green via Python-list
Stefan Ram wrote: > Chris Green writes: > >I have to say this seems very non-pythonesque to me, the 'obvious' > >default simply doesn't work right, and I really can't think of a case > >where the missing comma would make any sense at all. > > |6.15 Expression lists > ... > |an expression list co

Re: Silly/crazy problem with sqlite

2023-11-25 Thread Thomas Passin via Python-list
On 11/24/2023 4:49 PM, Rimu Atkinson via Python-list wrote: I really can't think of a case where the missing comma would make any sense at all. That is pretty tricky, yes. The comma means it's a tuple. Without the comma, it's just a string with parenthesis around it, which is a string.

Re: Silly/crazy problem with sqlite

2023-11-25 Thread Mats Wichmann via Python-list
On 11/24/23 14:10, Chris Green via Python-list wrote: Chris Green wrote: This is driving me crazy, I'm running this code:- OK, I've found what's wrong:- cr.execute(sql, ('%' + "2023-11" + '%')) should be:- cr.execute(sql, ('%' + x + '%',) ) I have to say this seems very

Re: Silly/crazy problem with sqlite

2023-11-25 Thread Sibylle Koczian via Python-list
Am 24.11.2023 um 22:49 schrieb Rimu Atkinson via Python-list: I really can't think of a case where the missing comma would make any sense at all. That is pretty tricky, yes. The comma means it's a tuple. Without the comma, it's just a string with parenthesis around it, which is a strin

Re: Silly/crazy problem with sqlite

2023-11-25 Thread Chris Green via Python-list
Chris Green wrote: > This is driving me crazy, I'm running this code:- OK, I've found what's wrong:- > cr.execute(sql, ('%' + "2023-11" + '%')) should be:- cr.execute(sql, ('%' + x + '%',) ) I have to say this seems very non-pythonesque to me, the 'obvious' default simply doesn'

Silly/crazy problem with sqlite

2023-11-25 Thread Chris Green via Python-list
This is driving me crazy, I'm running this code:- #!/usr/bin/env python3 # # # Show the electric fence history, default to last 24 hours # import sqlite3 import datetime import sys today = datetime.datetime.now()

Re: Silly/crazy problem with sqlite

2023-11-25 Thread Rimu Atkinson via Python-list
I really can't think of a case where the missing comma would make any sense at all. That is pretty tricky, yes. The comma means it's a tuple. Without the comma, it's just a string with parenthesis around it, which is a string. PyDev console: starting. Python 3.9.15 (main, Oct 28 2022

Re: Changing the original SQLite version to the latest

2023-02-15 Thread jose isaias cabrera
On Tue, Feb 14, 2023 at 8:55 PM Thomas Passin wrote: > > On 2/14/2023 3:30 PM, jose isaias cabrera wrote: > > Greetings. > > > > I have tried both Cygwin and SQLite support, and I have received very > > little ideas from them, so I am trying this to see if anyone has

Re: Changing the original SQLite version to the latest

2023-02-14 Thread Frank Millman
On 2023-02-15 5:59 AM, Thomas Passin wrote: > > "Download the latest release from http://www.sqlite.org/download.html > and manually copy sqlite3.dll into Python's DLLs subfolder." > I have done exactly this a number of times and it has worked for me. Frank Millman -- https://m

Re: Changing the original SQLite version to the latest

2023-02-14 Thread Thomas Passin
On 2/14/2023 9:29 PM, jose isaias cabrera wrote: On Tue, Feb 14, 2023 at 8:55 PM Thomas Passin wrote: As a point of reference, the Python installation I've got on my Windows box (not a cygwin install) is Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)] o

Re: Changing the original SQLite version to the latest

2023-02-14 Thread jose isaias cabrera
On Tue, Feb 14, 2023 at 8:55 PM Thomas Passin wrote: > > As a point of reference, the Python installation I've got on my Windows > box (not a cygwin install) is > > Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 > 64 bit (AMD64)] on win32 > > and the sqlite_version is 3.39

Re: Changing the original SQLite version to the latest

2023-02-14 Thread Thomas Passin
On 2/14/2023 3:30 PM, jose isaias cabrera wrote: Greetings. I have tried both Cygwin and SQLite support, and I have received very little ideas from them, so I am trying this to see if anyone has dealt with such a problem before. If I use Cygwin setup tool and install python39 and thus

Changing the original SQLite version to the latest

2023-02-14 Thread jose isaias cabrera
Greetings. I have tried both Cygwin and SQLite support, and I have received very little ideas from them, so I am trying this to see if anyone has dealt with such a problem before. If I use Cygwin setup tool and install python39 and thus, $ python Python 3.9.10 (main, Jan 20 2022, 21:37:52) [GCC

Re: sqlite3 cannot detect the version of compiled sqlite version at some point in runtime.

2021-01-20 Thread panfei
1033 C_INCLUDE_PATH=/home/felix/.local/sqlite/default/include/ CPLUS_INCLUDE_PATH=/home/felix/.local/sqlite/default/include/ LD_RUN_PATH=/home/felix/.local/sqlite/default/lib ./configure --prefix=/home/felix/.local/python/python-3.9.1 --enable-optimizations 1034 C_INCLUDE_PATH=/home/felix

Re: sqlite3 cannot detect the version of compiled sqlite version at some point in runtime.

2021-01-20 Thread panfei
Hi Random: Thanks for the suggestion, I will test it right now. there is a file called sqlite3.pc in my installation. [felix@localhost pkgconfig]$ ll total 4 -rw-r--r-- 1 felix felix 315 Jan 20 12:51 sqlite3.pc [felix@localhost pkgconfig]$ pwd /home/felix/.local/sqlite/default/lib/pkgconfig 在

Re: sqlite3 cannot detect the version of compiled sqlite version at some point in runtime.

2021-01-20 Thread panfei
/.local/python/python-3.9.1/lib/python3.9/lib-dynload/_heapq.cpython-39-x86_64-linux-gnu.so 0x7fffef2d7180 0x7fffef2e08ba Yes /home/felix/.local/python/python-3.9.1/lib/python3.9/lib-dynload/_sqlite3.cpython-39-x86_64-linux-gnu.so 0x7fffeefadf00 0x7fffef096c00 Yes /home/felix/

Re: sqlite3 cannot detect the version of compiled sqlite version at some point in runtime.

2021-01-20 Thread Random832
On Wed, Jan 20, 2021, at 16:45, Random832 wrote: > On Wed, Jan 20, 2021, at 14:54, panfei wrote: > > 3. Compile Python 3.9.1 > > C_INCLUDE_PATH=/home/felix/.local/sqlite/sqlite-3.34.0/include/ > > CPLUS_INCLUDE_PATH=/home/felix/.local/sqlite/sqlite-3.34.0/include/ > &

Re: sqlite3 cannot detect the version of compiled sqlite version at some point in runtime.

2021-01-20 Thread Barry Scott
> On 20 Jan 2021, at 19:54, panfei wrote: > > System environment: > > Cent OS 7 > Sqlite3 3.34.0 (Compile from source) > Python 3.9.1 (Compile from source) > Django 3.1.5 (Pip install) > > > 1. Compile sqlite3: > ./configure --prefix=/home/felix/.local

Re: sqlite3 cannot detect the version of compiled sqlite version at some point in runtime.

2021-01-20 Thread Random832
On Wed, Jan 20, 2021, at 14:54, panfei wrote: > 3. Compile Python 3.9.1 > C_INCLUDE_PATH=/home/felix/.local/sqlite/sqlite-3.34.0/include/ > CPLUS_INCLUDE_PATH=/home/felix/.local/sqlite/sqlite-3.34.0/include/ > LD_RUN_PATH=/home/felix/.local/sqlite/default/lib ./configure > --pre

Re: sqlite3 cannot detect the version of compiled sqlite version at some point in runtime.

2021-01-20 Thread Ben Bacarisse
te3.connect(':memory:') >>>> conn.create_function('f', 2, lambda *args: None, deterministic=True) > Traceback (most recent call last): > File "", line 1, in > sqlite3.NotSupportedError: deterministic=True requires SQLite 3.8.3 or higher >>>>

sqlite3 cannot detect the version of compiled sqlite version at some point in runtime.

2021-01-20 Thread panfei
System environment: Cent OS 7 Sqlite3 3.34.0 (Compile from source) Python 3.9.1 (Compile from source) Django 3.1.5 (Pip install) 1. Compile sqlite3: ./configure --prefix=/home/felix/.local/sqlite/sqlite-3.34.0 make && make install 2. Add sqlite3 lib to lib search path: export LD_LIBR

How to specify sqlite engine path in sqlalchemy using Zipapp

2020-01-16 Thread Abdur-Rahmaan Janhangeer
I don't know how to specify sqlalchemy's engine path for sqlite within zipapp. Using: engine = create_engine('sqlite:///{}'.format( os.path.join(dirp, 'db/items.db') )) i get unable to open database file I've rounded the problem with as

Packaging Sqlite DB and Pictures with Executable file

2019-12-31 Thread Abdur-Rahmaan Janhangeer
Greetings list, Sometimes ago i was asking how to add Sqlite files to zipapp files here <https://mail.python.org/pipermail/python-list/2019-December/894502.html>, i still haven't figured it out. Finally the solution i used was PyInstaller itself. Kushal Das shared an article <https

Re: Zipapp can't find sqlite db

2019-12-12 Thread Abdur-Rahmaan Janhangeer
Packaging in this case means converting a folder into a zipapp archive. Yours, Abdur-Rahmaan Janhangeer pythonmembers.club | github Mauritius > > -- https://mail.python.org/mailman/listinfo/python-list

Re: Zipapp can't find sqlite db

2019-12-12 Thread Abdur-Rahmaan Janhangeer
Do you have a data files tuto link? Yours, Abdur-Rahmaan Janhangeer pythonmembers.club | github Mauritius > > -- https://mail.python.org/mailman/listinfo/python-list

Re: Zipapp can't find sqlite db

2019-12-07 Thread Barry Scott
> On 7 Dec 2019, at 10:07, dieter wrote: > > Abdur-Rahmaan Janhangeer writes: >> I'm using zipapp to include a gui + db >> >> __main__.py >> dbs/ >>file.db >> >> When packaging, the db is there. When querying through sqlalchemy, it says >> can't open db file. Help appreciated! > > I am

Re: Zipapp can't find sqlite db

2019-12-07 Thread dieter
Abdur-Rahmaan Janhangeer writes: > I'm using zipapp to include a gui + db > > __main__.py > dbs/ > file.db > > When packaging, the db is there. When querying through sqlalchemy, it says > can't open db file. Help appreciated! I am unsure what you mean with "packaging". If you mean "create a p

Zipapp can't find sqlite db

2019-12-06 Thread Abdur-Rahmaan Janhangeer
Greetings, I'm using zipapp to include a gui + db __main__.py dbs/ file.db When packaging, the db is there. When querying through sqlalchemy, it says can't open db file. Help appreciated! Yours, Abdur-Rahmaan Janhangeer pythonmembers.club | github

Re: Create multiple sqlite tables, many-to-many design

2019-08-15 Thread Peter Otten
Chris Angelico wrote: > On Thu, Aug 15, 2019 at 7:41 PM Gregory Ewing > wrote: >> >> Chris Angelico wrote: >> > I prefer to say "Trails" for the table, and "Trail" would then refer >> > to a single row from that table. >> >> That makes sense for a data structure in your program that contains a >>

Re: Create multiple sqlite tables, many-to-many design

2019-08-15 Thread Chris Angelico
On Thu, Aug 15, 2019 at 7:41 PM Gregory Ewing wrote: > > Chris Angelico wrote: > > I prefer to say "Trails" for the table, and "Trail" would then refer > > to a single row from that table. > > That makes sense for a data structure in your program that contains a > collection of rows. But I've come

Re: Create multiple sqlite tables, many-to-many design

2019-08-15 Thread Gregory Ewing
Chris Angelico wrote: I prefer to say "Trails" for the table, and "Trail" would then refer to a single row from that table. That makes sense for a data structure in your program that contains a collection of rows. But I've come to the view that SQL tends to read better if the names of the datab

Re: Create multiple sqlite tables, many-to-many design

2019-08-14 Thread Rich Shepard
On Wed, 14 Aug 2019, Chris Angelico wrote: I prefer to say "Trails" for the table, and "Trail" would then refer to a single row from that table. +1 Rich -- https://mail.python.org/mailman/listinfo/python-list

Re: Create multiple sqlite tables, many-to-many design

2019-08-14 Thread Chris Angelico
On Wed, Aug 14, 2019 at 9:06 PM Gregory Ewing wrote: > > MRAB wrote: > > Another thing you might want to avoid is naming something with what it > > is, e.g. "Trails_Table" (why not just "Trails"). > > Or possibly just "Trail", since any table potentially contains > multiple rows, so making all you

Re: Create multiple sqlite tables, many-to-many design

2019-08-14 Thread Gregory Ewing
MRAB wrote: Another thing you might want to avoid is naming something with what it is, e.g. "Trails_Table" (why not just "Trails"). Or possibly just "Trail", since any table potentially contains multiple rows, so making all your table names plural doesn't add any information. -- Greg -- https:

Re: Create multiple sqlite tables, many-to-many design

2019-08-13 Thread Rich Shepard
On Wed, 14 Aug 2019, MRAB wrote: The actual code is different. htbl, ttbl, jtbl, etc. Too short? Definitely! :-) Another thing you might want to avoid is naming something with what it is, e.g. "Trails_Table" (why not just "Trails"). Another reason to read Celko's 'SQL Programming Style.'

Re: Create multiple sqlite tables, many-to-many design

2019-08-13 Thread MRAB
On 2019-08-13 22:11, Dave via Python-list wrote: On 8/13/19 4:45 PM, MRAB wrote: On 2019-08-13 19:59, Chris Angelico wrote: On Wed, Aug 14, 2019 at 4:50 AM Dave via Python-list wrote: Some of the tables are related.  For example: Hiking_Table Trails_Table    Joining_Table

Re: Create multiple sqlite tables, many-to-many design

2019-08-13 Thread Dave via Python-list
On 8/13/19 5:46 PM, Rich Shepard wrote: On Tue, 13 Aug 2019, Rich Shepard wrote: Read Joe Celko's books, starting with his SQL Programming Guide, then SQL That should be SQL Programming Style Rich Rich, On my next trip to BN I'll see if they have them. That is long term though. Right n

Re: Create multiple sqlite tables, many-to-many design

2019-08-13 Thread Rich Shepard
On Tue, 13 Aug 2019, Rich Shepard wrote: Read Joe Celko's books, starting with his SQL Programming Guide, then SQL That should be SQL Programming Style Rich -- https://mail.python.org/mailman/listinfo/python-list

Re: Create multiple sqlite tables, many-to-many design

2019-08-13 Thread Chris Angelico
On Wed, Aug 14, 2019 at 7:26 AM Dave via Python-list wrote: > Thanks for the note. I get the theory of MTM and the join table. It is > the implementation I don't get. Let me see if I can demonstrate my > confusion using pseudo code. > > def dbDataInsert(): > > sql_HikeInsert = """ INSERT I

Re: Create multiple sqlite tables, many-to-many design

2019-08-13 Thread Rich Shepard
On Tue, 13 Aug 2019, Dave via Python-list wrote: I do indeed. I did that so it was easy for everyone to follow. Having started with assm. and C, I have to remind myself to be more explanatory in naming. Guess I over-did it. The actual code is different. htbl, ttbl, jtbl, etc. Too short? Dave,

Re: Create multiple sqlite tables, many-to-many design

2019-08-13 Thread Dave via Python-list
On 8/13/19 2:59 PM, Chris Angelico wrote: On Wed, Aug 14, 2019 at 4:50 AM Dave via Python-list wrote: Some of the tables are related. For example: Hiking_Table Trails_TableJoining_Table -- hike_id PK

Re: Create multiple sqlite tables, many-to-many design

2019-08-13 Thread Dave via Python-list
On 8/13/19 4:45 PM, MRAB wrote: On 2019-08-13 19:59, Chris Angelico wrote: On Wed, Aug 14, 2019 at 4:50 AM Dave via Python-list wrote: Some of the tables are related.  For example: Hiking_Table Trails_Table    Joining_Table -       

Re: Create multiple sqlite tables, many-to-many design

2019-08-13 Thread MRAB
On 2019-08-13 19:59, Chris Angelico wrote: On Wed, Aug 14, 2019 at 4:50 AM Dave via Python-list wrote: Some of the tables are related. For example: Hiking_Table Trails_TableJoining_Table -- hike_id PK

Re: Create multiple sqlite tables, many-to-many design

2019-08-13 Thread Chris Angelico
On Wed, Aug 14, 2019 at 4:50 AM Dave via Python-list wrote: > Some of the tables are related. For example: > > Hiking_Table Trails_TableJoining_Table > -- > hike_id PK trail_id PKhik

Create multiple sqlite tables, many-to-many design

2019-08-13 Thread Dave via Python-list
Oops! Just posted this to the wrong newsgroup. Sorry!!! I'm doing a Python app that uses SQLite, and am stumbling on a few questions. I've read a lot of books and documentation, but two questions still allude me. Ho

Re: Python/SQLite best practices

2019-08-06 Thread Chris Angelico
On Wed, Aug 7, 2019 at 2:28 AM Dennis Lee Bieber wrote: > > On Mon, 5 Aug 2019 20:12:27 +0200, Karsten Hilbert > declaimed the following: > > > >Transactions involving several commands may require passing > >around of connections and/or cursors, however. > > > > Probably both -- as I reca

Re: Python/SQLite best practices

2019-08-06 Thread Jonathan Moules
nning-python-process" should show the path of the sqlite library that is linked to the Python executable, which should let you learn this. Thanks, I'll have to add that to the collection. I know when I was googling around for it on *nix I came across a bunch of different answers none of wh

Re: Python/SQLite best practices

2019-08-05 Thread Cameron Simpson
On 06Aug2019 00:01, Jonathan Moules wrote: Some gotcha tips from using SQLite with Python that I've encountered. [...] * To be reliably INSERTed Byte data should be first converted to sqlite3.Binary(my_data) explicitly Interesting. Is that Python 2 specific, or also in Python 3. Be

Re: Python/SQLite best practices

2019-08-05 Thread Jonathan Moules
Some gotcha tips from using SQLite with Python that I've encountered. You may already know some/all of these: * SQLite doesn't have a "Truncate" function - simply delete the file if possible for larger datasets. * Explicitly committing is good because the default python s

Re: Python/SQLite best practices

2019-08-05 Thread Chris Angelico
used to be implicit commits as well as implicit begins > ("Changed in version 3.6: sqlite3 used to implicitly commit an open > transaction before DDL statements. This is no longer the case.") Maybe > because I was new to both Python and SQLite at the time, but there was a

RE: Python/SQLite best practices

2019-08-05 Thread David Raymond
eview I guess I should have phrased it more as a "here's what I've found for reference" rather than a "here's what _you_ should do" Part of it is large use of the Command Line Interface for SQLite, and similar command line tools for other db's, which al

Re: Python/SQLite best practices

2019-08-05 Thread Chris Angelico
On Tue, Aug 6, 2019 at 5:05 AM David Raymond wrote: > I believe the default Connection context manager is set up for the context to > be a single transaction, with a commit on success or a rollback on a failure. > As far as I know it does NOT close the connection on exiting the context > manage

RE: Python/SQLite best practices

2019-08-05 Thread David Raymond
nsaction stuff cur.execute("commit;") except something bad: blah finally: conn.rollback() conn.close() -Original Message- From: Python-list On Behalf Of Dave via Python-list Sent: Monday, August 05, 2019 1:49 PM To: python-list@python.org Subject: Py

Re: Python/SQLite best practices

2019-08-05 Thread Karsten Hilbert
On Mon, Aug 05, 2019 at 08:12:27PM +0200, Karsten Hilbert wrote: > Transactions involving several commands may require passing > around of connections and/or cursors, however. Among chains of python code, that is. Karsten -- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B -- https://mai

Re: Python/SQLite best practices

2019-08-05 Thread Karsten Hilbert
On Mon, Aug 05, 2019 at 01:49:24PM -0400, Dave via Python-list wrote: > * Passing connections and cursors - good, bad indifferent? I try to avoid > passing file handles unless necessary, so I view connections and cursors the > same. Connections may be more long-lived, per thread perhaps. Cursor

Python/SQLite best practices

2019-08-05 Thread Dave via Python-list
I'm looking for some tips from experienced hands on on this subject. Some of the areas of interest are (feel free to add more): * Passing connections and cursors - good, bad indifferent? I try to avoid passing file handles unless necessary, so I view connections and cursors the same. Though

Re: load extention spatialite in sqlite on windows

2019-07-10 Thread Chris Angelico
broke in the download or something. If it looks like a legit file, the next thing I'd look at is whether it's a 32-bit or 64-bit DLL; you have to match the word size of your SQLite binary. Unfortunately SQLite didn't give much info, so we're a bit in the dark here. This may require some research. ChrisA -- https://mail.python.org/mailman/listinfo/python-list

load extention spatialite in sqlite on windows

2019-07-10 Thread MICHAEL LANE via Python-list
Hi, I tried to reproduce this(https://geoalchemy-2.readthedocs.io/en/latest/spatialite_tutorial.html) in windows. How can I do that? I'm using Windows 10, my project use Pyramid Framework with Python 3.6.8. Even though I put the dll file in a directory defined in %PATH% or try with/without f

Re: Best practice for upgrading SQLite C library (DLL, SO, etc) that ships with Python

2019-01-05 Thread Frank Millman
"Malcolm Greene" wrote in message news:1546723194.1501226.1626474960.7ac72...@webmail.messagingengine.com... I noticed that there's a rather big gap between the latest version of SQLite and the version of SQLite that ships with Python 3.6/3.7. Is there best practice advice fo

Best practice for upgrading SQLite C library (DLL, SO, etc) that ships with Python

2019-01-05 Thread Malcolm Greene
I noticed that there's a rather big gap between the latest version of SQLite and the version of SQLite that ships with Python 3.6/3.7. Is there best practice advice for upgrading the SQLlite C library that ships with Python ... without causing havoc and mayhem on my system? Options Don&#x

Re: Read Firefox sqlite files with Python

2017-11-06 Thread Rustom Mody
On Monday, November 6, 2017 at 8:42:29 AM UTC+5:30, Steve D'Aprano wrote: > On Mon, 6 Nov 2017 12:39 am, Paul Moore wrote: > > > On 5 November 2017 at 01:22, Steve D'Aprano wrote: > >> On Sun, 5 Nov 2017 04:32 am, Steve D'Aprano wrote: > >> > >

Re: Read Firefox sqlite files with Python

2017-11-05 Thread Steve D'Aprano
On Mon, 6 Nov 2017 12:39 am, Paul Moore wrote: > On 5 November 2017 at 01:22, Steve D'Aprano > wrote: >> On Sun, 5 Nov 2017 04:32 am, Steve D'Aprano wrote: >> >>> I'm trying to dump a Firefox IndexDB sqlite file to text using Python 3.5. >>&g

Re: Read Firefox sqlite files with Python

2017-11-05 Thread Paul Moore
On 5 November 2017 at 01:22, Steve D'Aprano wrote: > On Sun, 5 Nov 2017 04:32 am, Steve D'Aprano wrote: > >> I'm trying to dump a Firefox IndexDB sqlite file to text using Python 3.5. >> >> >> import sqlite3 >> con = sqlite3.connect('foo

Re: Read Firefox sqlite files with Python

2017-11-04 Thread Steve D'Aprano
On Sun, 5 Nov 2017 04:32 am, Steve D'Aprano wrote: > I'm trying to dump a Firefox IndexDB sqlite file to text using Python 3.5. > > > import sqlite3 > con = sqlite3.connect('foo.sqlite') > with open('dump.sql', 'w') as f: > for l

Re: Read Firefox sqlite files with Python

2017-11-04 Thread Sayth Renshaw
On Sunday, 5 November 2017 04:32:26 UTC+11, Steve D'Aprano wrote: > I'm trying to dump a Firefox IndexDB sqlite file to text using Python 3.5. > > > import sqlite3 > con = sqlite3.connect('foo.sqlite') > with open('dump.sql', 'w') as f

Re: Read Firefox sqlite files with Python

2017-11-04 Thread Peter Otten
Steve D'Aprano wrote: > I'm trying to dump a Firefox IndexDB sqlite file to text using Python 3.5. > > > import sqlite3 > con = sqlite3.connect('foo.sqlite') > with open('dump.sql', 'w') as f: > for line in con.iterdump

Read Firefox sqlite files with Python

2017-11-04 Thread Steve D'Aprano
I'm trying to dump a Firefox IndexDB sqlite file to text using Python 3.5. import sqlite3 con = sqlite3.connect('foo.sqlite') with open('dump.sql', 'w') as f: for line in con.iterdump(): f.write(line + '\n') The error I get is: Traceba

Re: sqlite in 2.7 on redhat 6

2017-06-16 Thread Thomas Jollans
On 15/06/17 14:45, Larry Martell wrote: > I am trying to use sqlite > > $ python2.7 > Python 2.7.10 (default, Feb 22 2016, 12:13:36) > [GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] on linux2 > Type "help", "copyright", "credits" or "license" fo

Re: sqlite in 2.7 on redhat 6

2017-06-15 Thread Larry Martell
On Thu, Jun 15, 2017 at 1:44 PM, Kushal Kumaran wrote: > Your python was built without sqlite3 support. If your yum repo > provider is unable to rebuild with sqlite3, you can do so yourself. > Make sure the sqlite-devel package is installed so your python build > will use it. Decide

Re: sqlite in 2.7 on redhat 6

2017-06-15 Thread Kushal Kumaran
t; On linux the system sqlite3 is used. >>>>> >>>>> I tried building and installing sqlite from source and that did not >>>>> solve the problem. >>>> >>>> You misunderstood: the problem is not sqlite3 it's that python needs >

Re: sqlite in 2.7 on redhat 6

2017-06-15 Thread Larry Martell
On Thu, Jun 15, 2017 at 12:20 PM, Kushal Kumaran wrote: > Larry Martell writes: > >> On Thu, Jun 15, 2017 at 10:35 AM, Peter Otten <__pete...@web.de> wrote: >>> Larry Martell wrote: >>> >>>>> On linux the system sqlite3 is used. >>>&

Re: sqlite in 2.7 on redhat 6

2017-06-15 Thread Kushal Kumaran
Larry Martell writes: > On Thu, Jun 15, 2017 at 10:35 AM, Peter Otten <__pete...@web.de> wrote: >> Larry Martell wrote: >> >>>> On linux the system sqlite3 is used. >>> >>> I tried building and installing sqlite from source and that did not

Re: sqlite in 2.7 on redhat 6

2017-06-15 Thread Peter Otten
Larry Martell wrote: > Sorry I mistyped - it wasn't pip it was yum. OK, I'm out then. Looks like what works for Debian derivatives is not easily transferable to Redhead... -- https://mail.python.org/mailman/listinfo/python-list

Re: sqlite in 2.7 on redhat 6

2017-06-15 Thread Larry Martell
On Thu, Jun 15, 2017 at 10:35 AM, Peter Otten <__pete...@web.de> wrote: > Larry Martell wrote: > >>> On linux the system sqlite3 is used. >> >> I tried building and installing sqlite from source and that did not >> solve the problem. > > You misund

Re: sqlite in 2.7 on redhat 6

2017-06-15 Thread Peter Otten
Larry Martell wrote: >> On linux the system sqlite3 is used. > > I tried building and installing sqlite from source and that did not > solve the problem. You misunderstood: the problem is not sqlite3 it's that python needs sqlite3's header files. >> Is that a P

Re: sqlite in 2.7 on redhat 6

2017-06-15 Thread Larry Martell
On Thu, Jun 15, 2017 at 9:55 AM, Peter Otten <__pete...@web.de> wrote: > Larry Martell wrote: > >> On Thu, Jun 15, 2017 at 8:56 AM, Mark Summerfield via Python-list >> wrote: >>> On Thursday, June 15, 2017 at 1:47:00 PM UTC+1, larry@gmail.com >>

Re: sqlite in 2.7 on redhat 6

2017-06-15 Thread Peter Otten
Larry Martell wrote: > On Thu, Jun 15, 2017 at 8:56 AM, Mark Summerfield via Python-list > wrote: >> On Thursday, June 15, 2017 at 1:47:00 PM UTC+1, larry@gmail.com >> wrote: >>> I am trying to use sqlite >>> >>> $ python2.7 >>> Python

Re: sqlite in 2.7 on redhat 6

2017-06-15 Thread Larry Martell
On Thu, Jun 15, 2017 at 8:56 AM, Mark Summerfield via Python-list wrote: > On Thursday, June 15, 2017 at 1:47:00 PM UTC+1, larry@gmail.com wrote: >> I am trying to use sqlite >> >> $ python2.7 >> Python 2.7.10 (default, Feb 22 2016, 12:13:36) >> [GCC 4.4.

Re: sqlite in 2.7 on redhat 6

2017-06-15 Thread Mark Summerfield via Python-list
On Thursday, June 15, 2017 at 1:47:00 PM UTC+1, larry@gmail.com wrote: > I am trying to use sqlite > > $ python2.7 > Python 2.7.10 (default, Feb 22 2016, 12:13:36) > [GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] on linux2 > Type "help", "copyright", "

sqlite in 2.7 on redhat 6

2017-06-15 Thread Larry Martell
I am trying to use sqlite $ python2.7 Python 2.7.10 (default, Feb 22 2016, 12:13:36) [GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import _sqlite3 Traceback (most rece

Re: sqlite 3 attribute error __exit__

2016-05-15 Thread Sayth Renshaw
(" + ", ".join("%s varchar" % fld for fld in horseattrs) + ")") I tried to change it to sqlite3 and it fails. I thought it may have been sqlite specific. Found this http://initd.org/psycopg/articles/2013/04/07/psycopg-25-released

Re: sqlite 3 attribute error __exit__

2016-05-15 Thread Sayth Renshaw
On Monday, 16 May 2016 12:45:26 UTC+10, DFS wrote: > On 5/15/2016 10:21 PM, Sayth Renshaw wrote: > > Hi > > > > I have a file and want to create the sqlite3 db. Using with however i > > receive an attribute error and it causes an exit. > > > > The relevant section of the file is: > > > > import s

Re: sqlite 3 attribute error __exit__

2016-05-15 Thread Ben Finney
Sayth Renshaw writes: > with conn, conn.cursor() as cur: What are you expecting this ‘with’ statement to do? As you've written it, the statement declares your intent to enter both ‘conn’ and ‘conn.cursor()’ as context managers. https://docs.python.org/3/reference/compound_stmts.html#with>

sqlite 3 attribute error __exit__

2016-05-15 Thread Sayth Renshaw
Hi I have a file and want to create the sqlite3 db. Using with however i receive an attribute error and it causes an exit. The relevant section of the file is: import sqlite3 conn = sqlite3.connect("trial.db") with conn, conn.cursor() as cur: # First, create tables. cur.execute("dr

Re: No SQLite newsgroup, so I'll ask here about SQLite, python and MS Access

2016-05-05 Thread cl
There's a gmane 'newsgroup from a mailing list' for sqlite:- gmane.comp.db.sqlite.general It's quite active and helpful too. (Also 'announce' and others) -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: No SQLite newsgroup, so I'll ask here about SQLite, python and MS Access

2016-05-04 Thread DFS
On 5/4/2016 10:02 PM, Stephen Hansen wrote: On Wed, May 4, 2016, at 03:46 PM, DFS wrote: I can't find anything on the web. Have you tried: http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users If you really must access it over a newsgroup, you can use the Gmane m

Re: No SQLite newsgroup, so I'll ask here about SQLite, python and MS Access

2016-05-04 Thread Michael Selik
On Wed, May 4, 2016, 6:51 PM DFS wrote: > Both of the following python commands successfully create a SQLite3 > datafile which crashes Access 2003 immediately upon trying to open it > (via an ODBC linked table). > Have you tried using Access 2013? On the other hand, a SQLite3 file created in VB

Re: No SQLite newsgroup, so I'll ask here about SQLite, python and MS Access

2016-05-04 Thread Stephen Hansen
On Wed, May 4, 2016, at 03:46 PM, DFS wrote: > I can't find anything on the web. Have you tried: http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users If you really must access it over a newsgroup, you can use the Gmane mirror: http://gmane.org/info.p

No SQLite newsgroup, so I'll ask here about SQLite, python and MS Access

2016-05-04 Thread DFS
river};Database=dfile.db') The file is created, a table is added, I add rows to the table in code, etc., and it can be read by 'DB Browser for SQLite' so it's a valid SQLite3 database, but Access won't read it. I can create and store a link to the table - using

Re: SQLite

2016-03-06 Thread Klaus Jantzen
org > From: [[2]2]k.d.jant...@mailbox.org > Subject: SQLite > Date: Sun, 21 Feb 2016 18:11:18 +0100 > > Hello, > > I have downloaded Python3.5.1 as .targz, compiled it(configure, make,...) > and it works > (under Debian Wh

Re: convert Dbase (.dbf) files to SQLite databases

2016-03-01 Thread Ethan Furman
On 03/01/2016 06:08 PM, Dennis Lee Bieber wrote: On Tue, 01 Mar 2016 08:49:08 -0800, Ethan Furman declaimed the following: Hmm, looks like that email was sent back in 2009. Sorry for the noise. I'm still not able to find a dbf module from John, though. Is it one of: https://www.g

Re: convert Dbase (.dbf) files to SQLite databases

2016-03-01 Thread Ethan Furman
Il giorno mercoledì 15 luglio 2009 18:30:29 UTC+2, John Machin ha scritto: Hmm, looks like that email was sent back in 2009. Sorry for the noise. I'm still not able to find a dbf module from John, though. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: convert Dbase (.dbf) files to SQLite databases

2016-03-01 Thread Ethan Furman
Il giorno mercoledì 15 luglio 2009 18:30:29 UTC+2, John Machin ha scritto: If dbfpy can't handle any new-fangled stuff you may have in your files, drop me a line ... I have a soon-to-be released DBF module that should be able to read the "new" stuff up to dBase7 and VFP9, including memo files,

Re: convert Dbase (.dbf) files to SQLite databases

2016-03-01 Thread starkwedder2009
Il giorno mercoledì 15 luglio 2009 18:30:29 UTC+2, John Machin ha scritto: > On Jul 15, 8:39 pm, David Lyon wrote: > > On Wed, 15 Jul 2009 11:53:28 +0200, Helmut Jarausch > > > > wrote: > > > Hi, > > > > > I have a lot of old Dbase files (.dbf) a

Re: SQLite

2016-02-22 Thread Chris Angelico
On Mon, Feb 22, 2016 at 7:40 PM, Klaus Jantzen wrote: >That did not work because I did not install Python 3.5. with apt-get >but downloaded the source and compiled myself. >Thus apt-get does not have any information about the Python 3.5 >installation. It generally does work; the b

Re: SQLite

2016-02-22 Thread Klaus Jantzen
On 02/22/2016 02:44 AM, Chris Angelico wrote: On Mon, Feb 22, 2016 at 8:37 AM, Albert-Jan Roskam [1] wrote: IIRC, you have to do sudo apt-get install build-essential python-dev ... then re-compile python That may well work, but it's probably easier to work this way: sudo apt-get build

Re: SQLite

2016-02-22 Thread Klaus Jantzen
On 02/21/2016 10:37 PM, Albert-Jan Roskam wrote: (Sorry for top posting) IIRC, you have to do sudo apt-get install build-essential python-dev ... then re-compile python > To: [1]python-list@python.org > From: [2]k.d.jant...@mailbox.org > Subjec

Re: SQLite

2016-02-21 Thread Chris Angelico
On Mon, Feb 22, 2016 at 8:37 AM, Albert-Jan Roskam wrote: > IIRC, you have to do > sudo apt-get install build-essential python-dev > ... then re-compile python That may well work, but it's probably easier to work this way: sudo apt-get build-dep python3 That should grab all the compilation depe

RE: SQLite

2016-02-21 Thread Albert-Jan Roskam
(Sorry for top posting) IIRC, you have to do sudo apt-get install build-essential python-dev ... then re-compile python > To: python-list@python.org > From: k.d.jant...@mailbox.org > Subject: SQLite > Date: Sun, 21 Feb 2016 18:11:18 +0100 > >Hello, > >I have d

SQLite

2016-02-21 Thread Klaus Jantzen
Hello, I have downloaded Python3.5.1 as .targz, compiled it(configure, make,...) and it works (under Debian Wheezy AMD64) up to the moment I wanted to use SQLite. I get the following message: === jantzen@PC4:~$ python Python 3.5.0 (default, Dec  2 2015, 14:16:16) [GCC

  1   2   3   4   5   6   7   8   >