Python Package: Directory Tree

nick3499
1 min readMay 1, 2017

--

A Python package consists of a file folder containing Python modules. Basically, a collection of .py files. To indicate that a particular file folder is a package, a typically empty file named __init__.py must be included within the designated package folder. Also, the name of that file folder becomes the name of the package, e.g. ecommerce. See file directory tree example below. Imagine that both of the __init__.py files displayed are empty.

parent_directory/
main.py
ecommerce/
__init__.py
database.py
products.py
payments/
__init__.py
square.py
stripe.py

--

--

nick3499
nick3499

Written by nick3499

coder of JavaScript and Python

No responses yet