-
-
Save richbpark/5aa27d83393e23a1f0d850de807ccb85 to your computer and use it in GitHub Desktop.
Interactive commands displaying all records using Python CLI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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