python_modules_and_packages

This is an old revision of the document!


Python Modules and Packages

  • A Python module is a file containing Python code.
  • A package is a group of modules in a subdirectory.
    • To make a directory package include a file in the directory named init.py.

Example

To create a package foo that contains a module bar and function hello.

from foo.bar import hello

hello()
  • python_modules_and_packages.1508439457.txt.gz
  • Last modified: 2017/10/19 18:57
  • by mgupton