def __init__(self, db,data_set,table,k):
     self.cursor = config_data(db)
     self.data_set, self.table,self.k = data_set, table, k
     self.terms()
     self.start = time.time()
     self.top_k = {}
     self.best_k = {}
Exemple #2
0
def query():
    query1 = "select origin, sum(arrivaldelay) from flights where carrier = 'US' group by origin order by origin"
    query2 = "select origin, sum(arrivaldelay) from flights group by origin order by origin"
    cursor = config_data(db)
    cursor.execute(query1)
    data1 = cursor.fetchall()
    cursor.execute(query2)
    data2 = cursor.fetchall()
    return data1, data2
import serial
import time

from config import config_data

cnf_dat = config_data()

ser = serial.Serial(cnf_dat["serial_port"],
                    9600)  #change ACM number as found from ls /dev/ttyUSB*
ser.baudrate = 9600

while True:
    read_ser = ser.readline()
    print(read_ser)
    if (read_ser == "Hello From Arduino!"):
        print("Blinked")
Exemple #4
0
 def __init__(self, db, groupby, table, k, aggregate):
     self.con, self.cursor = config_data(db)
     self.groupby, self.table,self.k,self.aggregate = groupby, table, k, aggregate
     self.terms()
     self.start = time.time()
     self.top_k = {}