class calendar.TextCalendar

TextCalendar class can be used to generate plain text calendars. TextCalendar class in Python allows you to edit the calendar and use it as per your requirement. 

Function Description
formatmonth() This method  is used to get the month’s calendar in a multi-line string
prmonth() This method  is used to print a month’s calendar as returned by formatmonth()
formatyear() This method is used to get m-column calendar for an entire year as a multi-line string
pryear() This method is used to print the calendar for an entire year as returned by formatmonth()

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.

Similar Reads

Calendar Module in Python

The calendar module allows us to output calendars like the program and provides additional useful functions related to the calendar. Functions and classes defined in the calendar module use an idealized calendar, the current Gregorian calendar is extended indefinitely in both directions. By default, these calendars have Monday as the first day of the week, and Sunday as the last (the European convention)....

class calendar.calendar

...

class calendar.TextCalendar

...

class calendar.HTMLCalendar :

The calendar class creates a calendar object. A calendar object provides several methods that can be used for preparing the calendar data for formatting. This class doesn’t do any formatting itself. This is the job of subclasses. The calendar class allows the calculations for various tasks based on date, month, and year and provides the following methods:...

Simple TextCalendar class

TextCalendar class can be used to generate plain text calendars. TextCalendar class in Python allows you to edit the calendar and use it as per your requirement....