Unit 5
Unit 5
5. You are allowed not only to import a module as a whole, but to import
only individual entities from it. In this case, the imported entities must
not be prefixed when used. Eg., from math import floor,
print(floor(-124.1245))
6. The most general form of the above statement allows you to import all
entities offered by a module. Eg., from math import *
7. You can change the name of the imported entity "on the fly" by using the
as phrase of the import. Eg., from math import abs as absolute
Working with Standard modules
1. A function named dir() can show you a list of the entities contained inside
an imported module
1. A repository (or repo for short) designed to collect and share free Python
code exists and works under the name Python Package Index (PyPI). It is
available at https://pypi.org/
2. To make use of PyPI, a specialized tool has been created and its name is
pip (pip installs packages while pip stands for... ok, never mind). As pip
may not be deployed as a part of the standard Python installation, it is
possible that you will need to install it manually. Pip is a console tool.
3. To check pip's version one the following commands should be issued:
pip --version
Continued
The list of the main pip activities looks as follows: