Pacific Beach Drive

Mike's Drive.

Follow me on GitHub

What is a Package?

  • a directory containing modules
  • Name of the package is the name of the directory
  • can have subpackages or subdirectories
  • located in the current working directory or PYTHONPATH

Organization Hierarchy

image application packages module

Importing Packages

  • connot import packages
  • must import specific module with the package
import package.module

object Reference

  • package.module.obj

Import Package Alias

import package.module as alias

object Reference

  • alias.obj

From Import Package

import package.module

object Reference

  • module.obj

AS an option, we can use the alias

import package import module as alias

object Reference

  • alias.obj