Python Language Difference between Module and Package Packages


A package is made up of multiple Python files (or modules), and can even include libraries written in C or C++. Instead of being a single file, it is an entire folder structure which might look like this:

Folder package


from import woof
from package.hi import hi

def woof():

def hi():
    print("Hello world!")

All Python packages must contain an file. When you import a package in your script (import package), the script will be run, giving you access to the all of the functions in the package. In this case, it allows you to use the package.hi and package.woof functions.