-
Notifications
You must be signed in to change notification settings - Fork 2
/
sqlite_bot.py
52 lines (36 loc) · 1.18 KB
/
sqlite_bot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import sqlite3
from twilio.rest import Client
def create_db():
mydb = sqlite3.connect('userdata.db')
mycursor = mydb.cursor()
mycursor.execute('''CREATE TABLE IF NOT EXISTS userdata
(phone TEXT, status TEXT, location TEXT)''')
mydb.commit()
mycursor.execute("SELECT * FROM userdata")
output = mycursor.fetchall()
print(output)
def peek():
mydb = sqlite3.connect('userdata.db')
mycursor = mydb.cursor()
mycursor.execute("SELECT * FROM userdata")
output = mycursor.fetchall()
print(output)
def peek_reminders():
mydb = sqlite3.connect('userdata.db')
mycursor = mydb.cursor()
mycursor.execute("SELECT * FROM reminders")
output = mycursor.fetchall()
print(output)
def create_reminder_db():
mydb = sqlite3.connect('userdata.db')
mycursor = mydb.cursor()
mycursor.execute('''CREATE TABLE IF NOT EXISTS reminders
(phone TEXT, location TEXT, options TEXT, hour TEXT, day TEXT, type TEXT)''')
mydb.commit()
mycursor.execute("SELECT * FROM reminders")
output = mycursor.fetchall()
print(output)
#create_db()
#create_reminder_db()
#peek()
#peek_reminders()