menu_book Course Curriculum (Raspberry Pi) expand_more
Linux & Setup
GPIO Digital I/O
Sensors & Buses
Automation
Networking & Services
local SQLite logging
Learn local SQLite logging in Raspberry Pi with a dedicated explanation, a concept-specific example, practical cautions, and a mastery check.
12 min read
•
Intermediate
Advertisement
raspberry-pi-032.py
python
import sqlite3,datetime
db=sqlite3.connect('/home/pi/sensors.db')
db.execute('create table if not exists readings(ts text, celsius real)')
db.execute('insert into readings values(?,?)',(datetime.datetime.now().isoformat(),24.6)); db.commit()
What to watch
Content source & attribution
Original Syntaxis Content · Original Syntaxis Content