Skip to content

Latest commit

 

History

History
15 lines (13 loc) · 439 Bytes

querying-sqlite-from-python.md

File metadata and controls

15 lines (13 loc) · 439 Bytes

Querying SQLite from Python

As capable as SQL is, sometimes it's easier to get something done with a python script. It's super easy to connect to an SQLite database from python with the sqlite3 module in the standard library and do whatever you need.

import sqlite3
con = sqlite3.connect("cc.db")
cur = con.cursor()
res = cur.execute("<query>")
rows = res.fetchall()
...