w3resource
w3resource logo

Python TextCalendar Module : month() method

(追記) (追記ここまで)
(追記) (追記ここまで)

month() method

The month() method is used to get a month’s calendar in a multi-line string using the formatmonth() of the TextCalendar class.

Syntax:

month(theyear, themonth, w=0, l=0)

Parameters:

Name Description Required /
Optional
Type
year Year for which the calendar should be generated. Required Number
month Month for which the calendar should be generated. Required Number
w The width between two columns. Default value is 0. Optional Number
l Blank line between two rows. Default value is 0. Optional Number

Example of month() method

import calendar
print(calendar.month(2016,5))

Output:

May 2016
Tu We Th Fr Sa Su Mo
 1 2
 3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31

PREV : prmonth()
NEXT :prcal()

Test your Python skills with w3resource's quiz



Follow us on Facebook and Twitter for latest update.

(追記) (追記ここまで)


(追記) (追記ここまで)
(追記) (追記ここまで)


AltStyle によって変換されたページ (->オリジナル) /