5.1 Using Python modules
So far, all the code we have seen or used has been built into Python, or we wrote it ourselves. Python uses modules to collect together function, class, and constant definitions so that you can reuse them by selectively bringing them into your environment. We can group modules in a hierarchical, tree-like structure to create packages. Together, these provide the functionality of libraries that we saw in section 1.4.
5.1.1 How do you get a module?
More than 200 modules come with the Python Standard Library. [PYL] Other than loading them into your environment via import
, you don’t need to install anything extra to use them. The math, fractions, random, and cmath modules we use in this
chapter are part of the standard library.
That’s not the full extent of pre-written code you can use. More than 200,000 modules are available from the Python Package Index. [PYPI]
...