Welcome folks today in this blog post we will be displaying calendar of given month and year using calendar module
All the full source code of the application is given below.
Get Started
In order to get started you need to make an app.py
file and copy paste the following code
app.py
1 2 3 4 5 6 7 8 9 10 11 |
# Python Calendar Example # import calendar module import calendar # ask of month and year year = int(input("Please Enter the year Number: ")) month = int(input("Please Enter the month Number: ")) # Displaying the Python calendar print(calendar.month(year, month)) |
Now if you execute the python
script by typing the below command as shown below
python app.py
As you can see we have taken the input
from the user in the form of month
and year
and then displaying the calendar in the command line