Python calendar module : prmonth() method Last Updated : 09 Feb, 2023 Comments Improve Suggest changes Like Article Like Report The calendar module allows the output of calendar-like programs and provides additional useful functions related to the calendar. Functions and classes defined in Calendar module use an idealized calendar, the current Gregorian calendar is extended indefinitely in both directions. class calendar.TextCalendar(firstweekday=0) can be used to generate plain text calendars. prmonth() method is one of the methods of TextCalendar instance. prmonth() method in Python is used to print a month’s calendar as returned by formatmonth(). Syntax: prmonth(year, month, width=0, lines=0) Parameter: year: year of the calendar month: month of the calendar width: [optional] Specifies the width of the date columns, which are centered line: [optional] Specifies the number of lines that each week will use. Returns: Return a month’s calendar. Code #1: Python3 # Python program to demonstrate working of prmonth() method # importing calendar module import calendar text_cal = calendar.TextCalendar(firstweekday = 0) year = 2018 month = 9 # default value of width is 0 # printing prmonth print(text_cal.prmonth(year, month)) Output: September 2018 Mo Tu We Th Fr Sa Su 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 None Code #2: With parameter width Python3 # Python program to demonstrate working of prmonth() method # importing calendar module import calendar text_cal = calendar.TextCalendar(firstweekday = 0) # default value of width is 0 # printing prmonth print(text_cal.prmonth(2018, 10, w = 5)) Output: October 2018 Mon Tue Wed Thu Fri Sat Sun 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 None Code #3: Python3 # Python program to demonstrate working of prmonth() method # importing calendar module import calendar text_cal = calendar.TextCalendar(firstweekday = 0) # giving value of width = 6, line = 2 # printing prmonth print(text_cal.prmonth(2018, 10, 6, 2)) Output: October 2018 Mon Tue Wed Thu Fri Sat Sun 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 None Comment More infoAdvertise with us Next Article Python calendar module : TextCalendar pryear() method S Shivam_k Follow Improve Article Tags : Misc Python python-modules Python Calander-module Practice Tags : Miscpython Similar Reads Python | Calendar Module Python defines an inbuilt module calendar that handles operations related to the calendar. In this article, we will see the Python Program to Display Calendar. Calendar Module in PythonThe calendar module allows us to output calendars like the program and provides additional useful functions related 5 min read Introduction to Python CalendarCalendar in PythonPython has a built-in Python Calendar module to work with date-related tasks. Using the module, we can display a particular month as well as the whole calendar of a year. In this article, we will see how to print a calendar month and year using Python. Calendar in Python ExampleInput: yy = 2023 mm = 2 min read Calendar Functions in Python | Set 2(monthrange(), prcal(), weekday()...)Some of calendar functions are discussed in the Set 1 1. monthrange(year, month) :- This function returns two integers, first, the starting day number of week(0 as monday) , second, the number of days in the month. 2. prcal(year, w, l, c) :- This function also prints the calendar of specific year bu 5 min read Working with Dates in Python CalendarHow to Get Current Date and Time using PythonIn this article, we will cover different methods for getting data and time using the DateTime module and time module in Python.Different ways to get Current Date and Time using PythonCurrent time using DateTime objectGet time using the time moduleGet Current Date and Time Using the Datetime ModuleIn 6 min read Working With Dates in PythonIn this article, we will discuss how to work with dates using python. Python makes dealing with dates and time very easy, all we have to do is import a module named DateTime that comes along with python. It is a more efficient way to work with date without the need of being explicitly programmed. By 4 min read Python program to print current year, month and dayIn this article, the task is to write a Python Program to print the current year, month, and day. Approach: In Python, in order to print the current date consisting of a year, month, and day, it has a module named datetime. From the DateTime module, import date classCreate an object of the date clas 1 min read Formatting Dates in PythonIn different regions of the world, different types of date formats are used and for that reason usually, programming languages provide a number of date formats for the developed to deal with. In Python, it is dealt with by using a liberty called DateTime. It consists of classes and methods that can 5 min read Calendar.Calendar FunctionsPython calendar module : iterweekdays() methodCalendar module allows to output calendars like program, and provides additional useful functions related to the calendar. Functions and classes defined in Calendar module use an idealized calendar, the current Gregorian calendar extended indefinitely in both directions. iterweekdays() method return 1 min read Python calendar module | itermonthdates() methodCalendar module allows to output calendars like program, and provides additional useful functions related to the calendar. Functions and classes defined in Calendar module use an idealized calendar, the current Gregorian calendar extended indefinitely in both directions. itermonthdates() method retu 2 min read Python calendar module : itermonthdays() methodCalendar module allows to output calendars like program, and provides additional useful functions related to the calendar. Functions and classes defined in Calendar module use an idealized calendar, the current Gregorian calendar extended indefinitely in both directions. itermonthdays() method retu 1 min read Python calendar module | itermonthdays2() methodCalendar module allows to output calendars like program, and provides additional useful functions related to the calendar. Functions and classes defined in Calendar module use an idealized calendar, the current Gregorian calendar extended indefinitely in both directions. itermonthdays2() method is u 2 min read Python calendar module : monthdatescalendar() methodCalendar module allows to output calendars like program, and provides additional useful functions related to the calendar. Functions and classes defined in Calendar module use an idealized calendar, the current Gregorian calendar extended indefinitely in both directions. monthdatescalendar() method 2 min read Python calendar module : monthdays2calendar() methodCalendar module allows to output calendars like program, and provides additional useful functions related to the calendar. Functions and classes defined in Calendar module use an idealized calendar, the current Gregorian calendar extended indefinitely in both directions. monthdays2calendar() method 2 min read Python calendar module | monthdayscalendar() methodCalendar module allows to output calendars like program, and provides additional useful functions related to the calendar. Functions and classes defined in Calendar module use an idealized calendar, the current Gregorian calendar extended indefinitely in both directions. monthdayscalendar() method i 2 min read Python calendar module : yeardatescalendar() methodCalendar module allows to output calendars like program, and provides additional useful functions related to the calendar. Functions and classes defined in Calendar module use an idealized calendar, the current Gregorian calendar extended indefinitely in both directions. yeardatescalendar() method i 3 min read Python calendar module : yeardays2calendar() methodCalendar module allows to output calendars like program, and provides additional useful functions related to the calendar. Functions and classes defined in Calendar module use an idealized calendar, the current Gregorian calendar extended indefinitely in both directions. yeardays2calendar() method i 3 min read Python calendar module : yeardayscalendar() methodCalendar module allows to output calendars like program, and provides additional useful functions related to the calendar. Functions and classes defined in Calendar module use an idealized calendar, the current Gregorian calendar extended indefinitely in both directions. yeardayscalendar() method i 2 min read Calendar.TextCalendar FunctionsPython calendar module : prmonth() methodThe calendar module allows the output of calendar-like programs and provides additional useful functions related to the calendar. Functions and classes defined in Calendar module use an idealized calendar, the current Gregorian calendar is extended indefinitely in both directions. class calendar.Tex 2 min read Python calendar module : formatyear() methodCalendar module allows to output calendars like program, and provides additional useful functions related to the calendar. Functions and classes defined in Calendar module use an idealized calendar, the current Gregorian calendar extended indefinitely in both directions. class calendar.TextCalendar( 6 min read Python calendar module : TextCalendar pryear() methodCalendar module allows to output calendars like program, and provides additional useful functions related to the calendar. Functions and classes defined in Calendar module use an idealized calendar, the current Gregorian calendar extended indefinitely in both directions. class calendar.TextCalendar( 6 min read Calendar.HTMLCalendar FunctionsPython calendar module : HTMLCalendar formatyear() methodCalendar module allows to output calendars like program, and provides additional useful functions related to the calendar. Functions and classes defined in Calendar module use an idealized calendar, the current Gregorian calendar extended indefinitely in both directions. class calendar.HTMLCalendar( 9 min read Python calendar module : HTMLCalendar formatyearpage() methodCalendar module allows to output calendars like program, and provides additional useful functions related to the calendar. Functions and classes defined in Calendar module use an idealized calendar, the current Gregorian calendar extended indefinitely in both directions. class calendar.HTMLCalendar( 15+ min read Simple TextCalendar FunctionsPython calendar module | firstweekday() methodCalendar module allows to output calendars like program, and provides additional useful functions related to the calendar. Functions and classes defined in Calendar module use an idealized calendar, the current Gregorian calendar extended indefinitely in both directions. In Python, calendar.firstwee 2 min read Python calendar module | isleap() methodCalendar module allows to output calendars like program, and provides additional useful functions related to the calendar. Functions and classes defined in Calendar module use an idealized calendar, the current Gregorian calendar extended indefinitely in both directions. In Python, calendar.isleap() 2 min read Python calendar module : leapdays() methodCalendar module allows to output calendars like program, and provides additional useful functions related to the calendar. Functions and classes defined in Calendar module use an idealized calendar, the current Gregorian calendar extended indefinitely in both directions. In Python, calendar.leapdays 2 min read Like