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

calendar.calendar

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


Import

import calendar
from calendar import calendar

Signature & Overview

calendar.calendar(theyear, w=2, l=1, c=6, m=3)

Returns a year's calendar as a multi-line string.

Usage

import calendar

year_str = calendar.calendar(2026)
assert "2026" in year_str and "January" in year_str

Gotchas

REPL Inspect

from calendar import calendar
help(calendar)

Linked from

Related notes