On this page
calendar.prcal
Prev: calendar.monthrange | Up: calendar | Next: calendar.prmonth
Rel: calendar.calendar, calendar.Calendar, calendar.Day, calendar.firstweekday
Ref: docs.python.org — calendar.prcal
Tags: #public #python3 #stdlib #calendar
Import
import calendar
from calendar import prcal
Signature & Overview
calendar.prcal(theyear, w=0, l=0, c=6, m=3)
Print a year's calendar.
Usage
import calendar
import contextlib
import io
buf = io.StringIO()
with contextlib.redirect_stdout(buf):
calendar.prcal(2026)
assert "2026" in buf.getvalue()
Gotchas
- Prints directly to
sys.stdout: Usecalendar.calendar(year)when you need the string value.
REPL Inspect
from calendar import prcal
help(prcal)
Linked from
Related notes
- tuts/python3/stdlib_module/calendar/monthrange Linked here; links to this page; shared tags: #calendar, #stdlib
- tuts/python3/stdlib_module/calendar/prmonth Linked here; links to this page; shared tags: #calendar, #stdlib
- tuts/python3/stdlib_module/calendar/calendar Linked here; shared tags: #calendar, #stdlib
- tuts/python3/stdlib_module/calendar/Calendar_class Linked here; shared tags: #calendar, #stdlib
- tuts/python3/stdlib_module/calendar/Day Linked here; shared tags: #calendar, #stdlib
- tuts/python3/stdlib_module/calendar/firstweekday Linked here; shared tags: #calendar, #stdlib
- tuts/python3/stdlib_module/calendar links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/calendar/HTMLCalendar shared tags: #calendar, #stdlib
- tuts/python3/stdlib_module/calendar/IllegalMonthError shared tags: #calendar, #stdlib
- tuts/python3/stdlib_module/calendar/IllegalWeekdayError shared tags: #calendar, #stdlib