-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
30 lines (22 loc) · 790 Bytes
/
main.py
File metadata and controls
30 lines (22 loc) · 790 Bytes
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
from datetime import datetime
import sqlite3
con = sqlite3.connect("klass1.db")
cur = con.cursor()
cur.execute("CREATE TABLE if not exists lesson(weekday, name, start, end)")
cur.execute("""
INSERT INTO lesson VALUES(0 ,"тест", "8:00", "8:40")
""")
con.commit()
cur.execute("""
DELETE FROM lesson WHERE start = "8:00" and weekday=0
""")
con.commit()
res = cur.execute("SELECT name, start, end FROM lesson")
print(res.fetchall())
while True:
inp = input("stupid asking line!!!!!: ")
if inp == "schedule":
if input() == 'понедельник':
res = cur.execute('SELECT name, start, end FROM lesson WHERE weekday=0')
res = cur.execute("SELECT name, start, end FROM lesson")
print(res.fetchall())