Skip to content

Instantly share code, notes, and snippets.

@richbpark richbpark/interactive.sh Secret
Created Feb 9, 2019

Embed
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
You can’t perform that action at this time.