-
Notifications
You must be signed in to change notification settings - Fork 1
/
__init__.py
61 lines (48 loc) · 1.73 KB
/
__init__.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
59
60
61
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 28 19:44:37 2021
@author: bezbakri
"""
import calendar
from tkinter import *
from datetime import datetime
current_date = datetime.now()
year = int(current_date.strftime("%Y"))
def PrevYear():
global window
window.destroy()
global year
year -=1
window = Tk()
window.title("Calendar")
window.configure(background = "#B1F5F5")
window.geometry("800x800")
output = Label(window, text = calendar.calendar(year), font = "Consolas 11")
output.grid(row = 5, column = 1, padx = 20)
Button(window, text = "Last Year", command = PrevYear).grid(row = 7, column = 0)
Button(window, text = "Next Year", command = NextYear).grid(row = 7, column = 2)
window.mainloop()
def NextYear():
global window
window.destroy()
global year
year +=1
window = Tk()
window.title("Calendar")
window.configure(background = "#B1F5F5")
window.geometry("800x800")
output = Label(window, text = calendar.calendar(year), font = "Consolas 11")
output.grid(row = 5, column = 1, padx = 20)
Button(window, text = "Last Year", command = PrevYear).grid(row = 7, column = 0)
Button(window, text = "Next Year", command = NextYear).grid(row = 7, column = 2)
window.mainloop()
def DisplayCalendar():
window = Tk()
window.title("Calendar")
window.configure(background = "#B1F5F5")
window.geometry("800x800")
output = Label(window, text = calendar.calendar(year), font = "Consolas 11")
output.grid(row = 5, column = 1, padx = 20)
Button(window, text = "Last Year", command = PrevYear).grid(row = 7, column = 0)
Button(window, text = "Next Year", command = NextYear).grid(row = 7, column = 2)
window.mainloop()