-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
50 lines (40 loc) · 1.3 KB
/
main.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
import time
import calendar
import locale
from datetime import datetime
from view.eventview import EventView
print("Bienvenue sur votre agenda personnel")
locale.setlocale(locale.LC_ALL, 'fr_FR.UTF-8')
currentyear = datetime.now().year
currentmonth = datetime.now().month
answer = ""
while answer != 'q':
view = EventView()
print("Nous sommes le : {}".format(datetime.today().strftime('%d %B %Y')))
print("\n__________________________\n")
print (calendar.month(currentyear, currentmonth, 2, 1))
print("Que souhaitez vous faire ? (v: voir les evenements, a: supprimer évenement, n: ajouter evenement, m: modifier, s: mois suivant, p: mois précédent, q: quitter)")
answer = input("appuyer sur la touche correspondante : ")
if answer == "s":
if currentmonth < 12:
currentmonth += 1
else:
currentmonth = 1
currentyear += 1
elif answer == "p":
if currentmonth > 1:
currentmonth -= 1
else:
currentmonth = 12
currentyear -= 1
elif answer == "v":
view.to_show_events()
elif answer== "n":
view.new_event()
elif answer == "a":
view.to_delete_event()
elif answer == "m":
view.to_update_event()
print("Merci et au revoir")
time.sleep(3)
exit()