41  Using other modules and packages

41.1 Python modules

As we have seen before, if a module is in standard library, simple import is enough.

import math

41.2 Directory/files

As we have talked before, we can use our own modules very easily, if they are in the same directory or sub-directories.

import example

41.3 use package manager (PIP)

If we use a package manager like PIP to install a package. We can easily use it.

python -m pip install emoji

then

import emoji
print(emoji.emojize('Python is :thumbs_up:'))

see longer PIP explanation in course notes.

41.4 Where this modules are stored?

import sys
print(sys.path)

41.5 You can add sys.path

If you add to sys.path any directory, you will be able to import it anywhere in your computer.