From the course: Learning Python

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Working with calendars

Working with calendars - Python Tutorial

From the course: Learning Python

Working with calendars

- [Instructor] All right, let's wrap up this chapter by taking a look at a few examples of how to work with calendars in Python. So Python's library provides a couple of useful utilities for working with calendars in both text and HTML formats, as well as some other date and calendar utilities. So let's take a look at the module for how to work with this. So let's open up our calendars_start.py file and in order to use the calendar module in a Python app, you first need to import the module. So let's go ahead and do that. So I'll import the calendar. And that statement will import all the various classes from the calendar module into my app. So let's start off by just creating a plain text calendar. So to do that, I'm going to use the TextCalendar class. So I'm going to write calendar.TextCalendar and I'm going to specify that the week should begin on Sundays. And then I'll format this into a string. So I'll call the…

Contents