app.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 |
from tkinter import * import calendar def showCal() : new_gui = Tk() new_gui.config(background = "white") new_gui.title("CALENDAR") new_gui.geometry("550x600") fetch_year = int(year_field.get()) cal_content = calendar.calendar(fetch_year) cal_year = Label(new_gui, text = cal_content, font = "Consolas 10 bold") cal_year.grid(row = 5, column = 1, padx = 20) new_gui.mainloop() if __name__ == "__main__" : gui = Tk() gui.config(background = "white") gui.title("CALENDAR") gui.geometry("250x140") cal = Label(gui, text = "CALENDAR", bg = "dark gray", font = ("times", 28, 'bold')) year = Label(gui, text = "Enter Year", bg = "light green") year_field = Entry(gui) Show = Button(gui, text = "Show Calendar", fg = "Black", bg = "Red", command = showCal) Exit = Button(gui, text = "Exit", fg = "Black", bg = "Red", command = exit) cal.grid(row = 1, column = 1) year.grid(row = 2, column = 1) year_field.grid(row = 3, column = 1) Show.grid(row = 4, column = 1) Exit.grid(row = 6, column = 1) gui.mainloop() |