[Tutor] make a sqlite3 database from an ordinary text file

Alan Gauld alan.gauld at yahoo.co.uk
Mon Jun 20 14:01:15 EDT 2022


On 20/06/2022 09:45, Roel Schroeven wrote:

>> NEVER initialised a DB/TBL this way. Easy for me to say: I learned RDBMS
>> and SQL very early in my career, and therefore know to use the tools
>> from that eco-system. (the rationale in books is the exact opposite -
>> presuming the reader has never used DB-tools). Use the best tool for the
>> job!
> I don't really agree with this. I quite often use Python to read data 
> from some file, perhaps process it a bit, then store it in SQL. 

Roel,

We weren't saying not to use Python for processing SQL data.
It was specifically about creating the schema in Python
(and to a lesser degree loading it with initial data). You
can do it but it's usually much easier to do it directly
in SQL (which you have to embed in the Python code anyway!)

Once you have some data in a database using Python to process
the data makes sense.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list