Wednesday, 6 July 2016

Python: TextCalendar: Generate plain text calendars.

‘calendar.TextCalendar(firstweekday=0)’ is used to generate plain text calendars. Following table summarizes the methods in TextCalendar class.


Method
Description
formatmonth(theyear, themonth, w=0, l=0)
Returns the months calendar. ‘w’ specifies the width of the date columns and ‘l’ specifies the number of lines that each week will use.
prmonth(theyear, themonth, w=0, l=0)
Print months calendar. It internally uses formatmonth() method. ‘w’ specifies the width of the date columns and ‘l’ specifies the number of lines that each week will use.
formatyear(theyear, w=2, l=1, c=6, m=3)
Return m-column calendar year. ‘w’ specifies date column width, ‘l’ specifies lines per week, ‘c’ specifies number spaces between month columns.
pryear(theyear, w=2, l=1, c=6, m=3)
Print the calendar for entire year. It internally uses ‘formatyear’ method. ‘w’ specifies date column width, ‘l’ specifies lines per week, ‘c’ specifies number spaces between month columns.


Previous                                                 Next                                                 Home

No comments:

Post a Comment