On this page
  1. calendar.prmonth
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

calendar.prmonth

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


Import

import calendar
from calendar import prmonth

Signature & Overview

calendar.prmonth(theyear, themonth, w=0, l=0)

Print a month's calendar.

Usage

import calendar
import contextlib
import io

buf = io.StringIO()
with contextlib.redirect_stdout(buf):
    calendar.prmonth(2026, 12)
assert "December 2026" in buf.getvalue()

Gotchas

REPL Inspect

from calendar import prmonth
help(prmonth)

Linked from

Related notes