User Guide
Table Of Contents
148
6.7 Modules and Packages
A module is a collection of functions and classes that are related
to a specific purpose. You can download modules that are
written by other programmers and use them in your projects.
Raspbian already has a large number of Python modules pre-
installed. To see a list of all the modules that are installed on your
Pi:
1. Click the Raspbian Menu, point to Programming,
and then click Python 3.
2. In the Python Shell, type the following command
and then press Enter:
help("modules")
Some of the most useful ones, particularly for Pi owners, are:
Module Description
base64 Functions for encoding and decoding in Base16,
Base32, and Base64 formats.
curses Functions for creating text-based terminal-style
windows with advanced features.
http Modules for making and receiving hypertext
transfer protocol (HTTP) requests over the web.
math Advanced math functions.
picamera Provides access to the Raspberry Pi camera from
Python scripts.
PIL Python Imaging Library. Adds the ability to edit
and convert image files from your Python scripts.
RPi.GPIO Functions to control the Pi’s GPIO pins from
Python.
xml Contains classes for working with extensible
markup language (XML) files in Python.