-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathEvents.py
58 lines (29 loc) · 1.17 KB
/
Events.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
53
54
55
56
57
58
from datetime import date
import mysql.connector
import Speak
import Config
class get_event:
def __init__(self):
sql_connection = mysql.connector.connect(host=Config.HOST_NAME, user=Config.USER_NAME, password=Config.PASSWORD, database=Config.DATABASE_NAME)
count: int = 0
event_list: list = []
connection = sql_connection.cursor()
today = date.today()
SQL = "SELECT activity from to_do where task_date = '" + str(today) + "';"
connection.execute(SQL)
result = connection.fetchall()
length = (len(result))
count: int = 0
if length == 0:
Speak.Speak('Sir No Events scheduled today')
print('Sir No Events scheduled today')
else:
for x in result:
event_number = count + 1
event_info = result[count]
Speak.Speak('Event Number ' + str(event_number))
print('Event Number ' + str(event_number))
Speak.Speak('Event Info ' + str(event_info))
print('Event Info ' + str(event_info))
count = count + 1
sql_connection.close()