Module, Package

Chris Angelico rosuav at gmail.com
Mon May 7 13:39:25 EDT 2018


On Tue, May 8, 2018 at 2:53 AM, Sharan Basappa <sharan.basappa at gmail.com> wrote:
> I am a bit confused between module and package in Python.
> Does a module contain package or vice versa?
> When we import something in Python, do we import a module or a package?

You import a module.

A package is one particular form of module, which is built out of
other modules (usually a directory full of .py files). There are a
number of different sorts of modules; regardless, you 'import X' and
get module X.

ChrisA



More information about the Python-list mailing list