[python] Forgot old query
This commit is contained in:
parent
7cbd141540
commit
1b416a5f22
|
@ -12,12 +12,10 @@ class TA:
|
|||
self.db.close()
|
||||
|
||||
# Data is a dictionary of samples labelled according to database columns
|
||||
def push(self, data):
|
||||
values = ''
|
||||
labels = ''
|
||||
for i in data:
|
||||
labels += ", %s" % i
|
||||
values += ", %s" % str(data[i])
|
||||
def put(self, data):
|
||||
labels = ', '.join(tuple(map(str,data.keys())))
|
||||
values = ', '.join(tuple(map(str,data.values())))
|
||||
|
||||
query = "INSERT INTO hourly (%s) VALUES (%s)" % (labels, values)
|
||||
|
||||
self.c.execute(query)
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
import subprocess
|
||||
import DomoticGateway as dg
|
||||
import TemperatureArchive as ta
|
||||
|
||||
import subprocess
|
||||
from time import sleep
|
||||
import sys
|
||||
import pandas as pd # E R(enzie) keffaaaa
|
||||
import pandas as pd
|
||||
import matplotlib as mpl
|
||||
mpl.use('Agg') # disable plot display
|
||||
import matplotlib.pyplot as plt
|
||||
import matplotlib.dates as pld
|
||||
|
||||
|
|
Loading…
Reference in New Issue