We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f4da83f commit f44458bCopy full SHA for f44458b
calendar_display/calendar_app.py
@@ -33,3 +33,17 @@ def display_calendar(year):
33
messagebox.showinfo(f"Calendar for {year}", cal_str)
34
except ValueError:
35
messagebox.showerror("Invalid Input", "Please enter a valid positive year")
36
+
37
38
+def show_calendar(year):
39
+ try:
40
+ year = int(year)
41
+ if year < 1:
42
+ raise ValueError
43
+ cal = calendar.TextCalendar()
44
+ cal_str = cal.formatyear(year)
45
+ messagebox.showinfo(f"Calendar for {year}", cal_str)
46
+ except ValueError:
47
+ messagebox.showerror("Invalid Input", "Please enter a valid positive year")
48
49
+ display_calendar(year)
0 commit comments