From f1648645c9f4ce29106eced37693305743b7b2c2 Mon Sep 17 00:00:00 2001 From: HariomSinghalPuri Date: Sat, 31 May 2025 23:01:47 +0530 Subject: [PATCH 1/4] feat: Add Calendar_Generator_YearWise project (Issue No : #106) --- .../Calendar_Generator_YearWise/Calendar.py | 87 +++++++++++++++++++ .../Calendar_Generator_YearWise/README.md | 52 +++++++++++ 2 files changed, 139 insertions(+) create mode 100644 Projects/Calendar_Generator_YearWise/Calendar.py create mode 100644 Projects/Calendar_Generator_YearWise/README.md diff --git a/Projects/Calendar_Generator_YearWise/Calendar.py b/Projects/Calendar_Generator_YearWise/Calendar.py new file mode 100644 index 0000000..dca6bf9 --- /dev/null +++ b/Projects/Calendar_Generator_YearWise/Calendar.py @@ -0,0 +1,87 @@ +# import all functions from the tkinter +from tkinter import * + +from tkinter import ttk + +#import Calendar module +import calendar + +def showCal(): + + #new calendar window + new_window = Tk() + + #setting the background color of GUI application + new_window.config(background = 'white') + + #setting the title of the GUI application + new_window.title("Calendar") + + #setting the geometry of the GUI application + new_window.geometry('550x600') + + # get method returns current text as string + fetch_year = int(year_field.get()) + + # calendar method of calendar module return + # the calendar of the given year . + cal_content = calendar.calendar(fetch_year) + + # Create a label for showing the content of the calender + cal_year = Label(new_window, text = cal_content, font = "Consolas 10 bold") + + # grid method is used for placing + # the widgets at respective positions + # in table like structure. + cal_year.grid(row = 5, column = 1, padx = 20) + + # start the GUI + new_window.mainloop() + + +if __name__=='__main__': + + #Create the basic gui window + root = Tk() + + #setting the background color of GUI application + root.config(background = 'white') + + #setting the title of the GUI application + root.title("HOME") + + #setting the geometry of the GUI application + root.geometry('500x400') + + # Create a CALENDAR : label with specified font and size + cal = Label(root, text = "Welcome to the calendar Application", bg = "Red", font = ("times", 20, 'bold')) + + #Create a Year label : a label to ask the user for year + year = Label(root, text = 'Please enter a year',bg = 'Green') + + #Create a Year Entry : Entry + year_field = Entry(root) + + # Create a Show Calendar Button and attached to showCal function + Show = Button(root, text = "Show Calendar", fg = "Black", bg = "Light Green", command = showCal) + + # Create a Exit Button and attached to exit function + Exit = Button(root, text = "Exit", fg = "Black", bg = "Light Green", command = exit) + + # grid method is used for placing + # the widgets at respective positions + # in table like structure. + 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) + + # start the GUI + root.mainloop() + + diff --git a/Projects/Calendar_Generator_YearWise/README.md b/Projects/Calendar_Generator_YearWise/README.md new file mode 100644 index 0000000..d8aa029 --- /dev/null +++ b/Projects/Calendar_Generator_YearWise/README.md @@ -0,0 +1,52 @@ +# Calendar Application + +A simple GUI calendar application built with Python and Tkinter that displays the calendar for any given year. +--- +## Features +- User-friendly interface +- Displays full year calendar in a clean format +- Responsive design +-Easy year input +--- +## Requirements +``` +Python 3.12.6 +Tkinter (usually comes with Python installation) +``` +## How to Use +- Run the application +- Enter a year in the input field +- Click "Show Calendar" button +-A new window will open displaying the calendar for the entered year +-Use the "Exit" button to close the application +--- + +## Code Structure +The application consists of: + +- Main window with input field + +- Calendar display window that opens when showing a calendar + +- Simple error handling for year input +--- +## How to Run +``` +python calendar_app.py +``` +--- + +## Customization +You can easily customize: +- Colors by modifying the bg (background) parameters +- Fonts by changing the font parameters +- Window sizes by adjusting the geometry values +--- +## Future Improvements +- Add month-specific calendar views +- Implement date selection functionality +- Add event management features +- Improve UI with modern styling +--- +## License +This project is open source and available under the MIT License. \ No newline at end of file From d64a52a1c26f408789f37312046ffd7c11c172c1 Mon Sep 17 00:00:00 2001 From: "@Singhalpuri07" Date: Sun, 1 Jun 2025 23:28:55 +0530 Subject: [PATCH 2/4] Update Projects/Calendar_Generator_YearWise/Calendar.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- Projects/Calendar_Generator_YearWise/Calendar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Calendar_Generator_YearWise/Calendar.py b/Projects/Calendar_Generator_YearWise/Calendar.py index dca6bf9..da18da6 100644 --- a/Projects/Calendar_Generator_YearWise/Calendar.py +++ b/Projects/Calendar_Generator_YearWise/Calendar.py @@ -1,5 +1,5 @@ # import all functions from the tkinter -from tkinter import * +from tkinter import Tk, Label, Entry, Button from tkinter import ttk From ec4ffb2b1b424d2d35802894d2411785bb2c4e76 Mon Sep 17 00:00:00 2001 From: "@Singhalpuri07" Date: Sun, 1 Jun 2025 23:29:04 +0530 Subject: [PATCH 3/4] Update Projects/Calendar_Generator_YearWise/Calendar.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- Projects/Calendar_Generator_YearWise/Calendar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Calendar_Generator_YearWise/Calendar.py b/Projects/Calendar_Generator_YearWise/Calendar.py index da18da6..91bb0bb 100644 --- a/Projects/Calendar_Generator_YearWise/Calendar.py +++ b/Projects/Calendar_Generator_YearWise/Calendar.py @@ -9,7 +9,7 @@ def showCal(): #new calendar window - new_window = Tk() + new_window = Toplevel() #setting the background color of GUI application new_window.config(background = 'white') From a833e7f6ca78728d4e753cbf09b84f2dccafe11b Mon Sep 17 00:00:00 2001 From: "@Singhalpuri07" Date: Sun, 1 Jun 2025 23:29:13 +0530 Subject: [PATCH 4/4] Update Projects/Calendar_Generator_YearWise/README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- Projects/Calendar_Generator_YearWise/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Calendar_Generator_YearWise/README.md b/Projects/Calendar_Generator_YearWise/README.md index d8aa029..3397ac7 100644 --- a/Projects/Calendar_Generator_YearWise/README.md +++ b/Projects/Calendar_Generator_YearWise/README.md @@ -6,7 +6,7 @@ A simple GUI calendar application built with Python and Tkinter that displays th - User-friendly interface - Displays full year calendar in a clean format - Responsive design --Easy year input +- Easy year input --- ## Requirements ```