Updating from chart manager
# store the temperature in the database def log_temperature(temp): conn=sqlite3.connect(dbname) curs=conn.cursor() curs.execute("INSERT INTO temps values(datetime('now'), (?))", (temp,)) # commit the changes conn.commit() conn.close() See this page for more information on accessing a database in Python. I used this directory because it's the standard directory for executable scripts in Apache.You can download the code for this project from Github: https://github.com/Pyplate/rpi_temp_logger.There's a button to download the project as a zip file at the bottom of the right hand column.Guaranteed for 50 years above ground and 25 years in ground or freshwater, its performance and properties are remarkable.
reads temperatures from a DS18B20 on a breadboard connected to GPIO, and stores them in an SQLite database.
contains a function called log_temperature which stores readings in the database.