On this page
  1. calendar.HTMLCalendar
  2. Import
  3. Signature & Overview
  4. Methods & Attributes
  5. Usage
  6. Gotchas
  7. REPL Inspect

calendar.HTMLCalendar

Prev: calendar.firstweekday | Up: calendar | Next: calendar.IllegalMonthError
Rel: calendar.calendar, calendar.Calendar, calendar.Day, calendar.firstweekday
Ref: docs.python.org — calendar.HTMLCalendar
Tags: #public #python3 #stdlib #calendar


Import

import calendar
from calendar import HTMLCalendar

Signature & Overview

calendar.HTMLCalendar(firstweekday=0)

This calendar returns complete HTML pages.

Methods & Attributes

Usage

import calendar

html = calendar.HTMLCalendar().formatmonth(2026, 12)
assert "<table" in html and "December 2026" in html

Gotchas

REPL Inspect

from calendar import HTMLCalendar
help(HTMLCalendar)

Linked from

Related notes