-
Notifications
You must be signed in to change notification settings - Fork 93
feat: Add Calendar_Generator_YearWise project (Issue No : #106) #109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
HariomSinghalPuri
wants to merge
4
commits into
king04aman:main
Choose a base branch
from
HariomSinghalPuri:calendar-generator
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
f164864
feat: Add Calendar_Generator_YearWise project (Issue No : #106)
HariomSinghalPuri d64a52a
Update Projects/Calendar_Generator_YearWise/Calendar.py
HariomSinghalPuri ec4ffb2
Update Projects/Calendar_Generator_YearWise/Calendar.py
HariomSinghalPuri a833e7f
Update Projects/Calendar_Generator_YearWise/README.md
HariomSinghalPuri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
# import all functions from the tkinter | ||
from tkinter import Tk, Label, Entry, Button | ||
|
||
from tkinter import ttk | ||
|
||
#import Calendar module | ||
import calendar | ||
|
||
def showCal(): | ||
|
||
#new calendar window | ||
new_window = Toplevel() | ||
|
||
#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() | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The README references 'calendar_app.py', but the actual script file is named 'Calendar.py'. Update the command to 'python Calendar.py' to match the file name. Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||
``` | ||
--- | ||
|
||
## 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. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Converting the input directly to int may crash on invalid input; consider adding a try/except block to handle non-integer values gracefully.
Copilot uses AI. Check for mistakes.