-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssignment 10.py
More file actions
62 lines (45 loc) · 1.49 KB
/
Assignment 10.py
File metadata and controls
62 lines (45 loc) · 1.49 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import calendar as c
import time as t
# ---------------------------------
# Creates an instance of a calendar
# ---------------------------------
cal = c.Calendar()
tCal = c.TextCalendar()
hCal = c.HTMLCalendar()
# ---------------------------------
# Calendar
# ---------------------------------
# An object that returns all days for the month includes week before and after
mon1 = cal.itermonthdates(2020, 3)
# A list that returns all days for the month includes week before and after
mon2 = cal.monthdatescalendar(2020, 3)
# A list that returns all days for the year includes week before and after
year1 = cal.yeardatescalendar(2020, 3)
# ---------------------------------
# Text calendar
# ---------------------------------
# month string
tMonth = tCal.formatmonth(2020, 3)
# print month string
tCal.prmonth(2020, 4)
# year string
tYear = tCal.formatyear(2020)
# print year string
tCal.pryear(2020)
# ---------------------------------
# HTML calendar
# ---------------------------------
# css day classes
hCal.cssclasses = ["mon red", "tue", "wed", "thu",
"fri", "sat text-bold", "sun text-bold"]
# css day header classes
hCal.cssclasses_weekday_head = ["mon blue", "tue", "wed", "thu",
"fri", "sat text-bold", "sun text-bold"]
# css month header classes
hCal.cssclass_month_head = 'head'
# month string
hMonth = hCal.formatmonth(2020, 3)
# year string
tYear = hCal.formatyear(2020)
# full year html page
tYearPage = hCal.formatyearpage(2020, 3, 'style.css')