The Python standard library is the built-in collection of modules and packages that supplies commonly needed functionality. Importing these modules helps programs reuse tested capabilities instead of repeating code. section 8.0 section 8.11
Common ways to work with the standard library include:
- Import a complete module, such as os. section 8.0
- Import selected names, such as sep from os. section 8.0
- Use standard-library types such as Decimal when their specialized behavior fits the problem. section 8.0
- Look beyond the standard library to PyPI when additional community packages are needed. section 8.0
Importing standard-library functionality
import os from os import sep from decimal import Decimal These forms make a module, a selected name, and a standard-library class available to the program. Choosing between them controls which names enter the local namespace. section 8.0
Table 8.1 What you need to know (view table figure)
| Re-imports an already loaded module, typically to update definitions during development |
|||
Use the reference table to compare import statements, module reloading, PyPI installation, and Decimal. section 8.0






