EMWIU/read_isitdown_database.py

18 lines
439 B
Python
Raw Permalink Normal View History

2018-12-25 00:58:46 +01:00
import sqlite3
import os
import sys
os.chdir(os.path.dirname(os.path.abspath(__file__)))
conn = sqlite3.connect("API.db")
cursor = conn.cursor()
cursor.execute(
"CREATE TABLE IF NOT EXISTS emwiu(id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE, url TEXT, email TEXT, ip TEXT, starttime TEXT)"
)
conn.commit()
cursor.execute("""SELECT * FROM emwiu""")
rows = cursor.fetchall()
conn.close()
for row in rows:
print(row)