Importing modules
We briefly touched on importing modules way back in Chapter 1, The Fundamentals of Python. Modules are also called libraries or packages. Modules are modular, often self-contained Python programs that are commonly utilized in other programs, hence the need to import them for access.
Modules are used to separate code to make a program easier to work with, as each module can be designed to do one thing well, rather than having to make a single program that is responsible for all logic.
The Python Package Index (PyPI) website (https://pypi.org) is the official repository of third-party Python libraries. At the time of writing, there are more than 150,000 packages available for download from PyPI. Most of these packages are ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access