This file contains hidden or 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
import sys | |
import dhtreader | |
DHT11 = 11 | |
DHT22 = 22 | |
AM2302 = 22 | |
dhtreader.init() |
This file contains hidden or 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
import csv, sqlite3 | |
conn = sqlite3.connect("converting2.sqlite") | |
curs = conn.cursor() | |
curs.execute("CREATE TABLE document (col1 TEXT, col2 TEXT, col3 TEXT, col4 TEXT,col5 TEXT);") | |
reader = csv.reader(open('Calendar.txt', 'rU'), delimiter=' ') | |
for row in reader: | |
to_db = [unicode(row[0], "utf8"), unicode(row[1], "utf8"), unicode(row[2], "utf8"), unicode(row[3], "utf8"), unicode(row[4], "utf8")] | |
curs.execute("INSERT INTO document VALUES (?, ?, ?,?,?);", to_db) | |
conn.commit() |
NewerOlder