Skip to content

Instantly share code, notes, and snippets.


richbpark/ Secret

Created Feb 9, 2019
What would you like to do?
Interactive commands displaying all records using Python CLI
(lab_app) root@RPiFSv2:/var/www/lab_app# python3
>>> import sqlite3
>>> conn=sqlite3.connect('/var/www/lab_app/lab_app.db')
>>> curs=conn.cursor()
>>> curs.execute("SELECT * FROM temperatures")
<sqlite3.Cursor object at 0x75db9d60> #NOTE: This is informational feedback. Don't Type
>>> temperatures = curs.fetchall()
>>> print (temperatures)
>>> conn.close()
>>> exit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment