In this lesson, you’ll learn about package initialization. If a file named __init__.py
is present in a package directory, it is invoked when the package or a module in the package is imported. You can use this to execute package initialization code, for example for the initialization of package-level data.
Consider the following __init__.py
file:
print(f'Invoking __init__.py for {__name__}')
alist = ['spam', 'bacon', 'eggs']
Add this file to the pkg
directory from the above example:

jeffwashcloth on May 13, 2020
What is the environment used in these videos? It’s pretty nifty, with its own file explorer, interpreter, and editor.