December 2012
Beginner
344 pages
7h 7m
English

As you learned in Chapter 7, a Python module is any combination of functions, classes, and variables. Python uses modules to group functions and classes in order to make them easier to use. For example, the turtle module, which we used in previous chapters, groups functions and classes that are used to create a canvas for a turtle to draw on the screen.
When you import a module into a program, you can use all of its contents. For example, when we imported the turtle module in Chapter 4, we had access to the Pen class, which we used to create an object representing the turtle’s canvas:
>>> import turtle>>> t = turtle.Pen() ...
Read now
Unlock full access