Skip to main content

Module vs Package vs Library

·53 words·1 min
Posts 101 python
Table of Contents
Here’s the differnce between a module, a package and library in Python.
Module
A single file that contain Python codes, functions, classes, etc.
import my_module
Package
A collection of modules stored in a directory.
Every package contains a __init__.py file.
Library
Refers to a collection of modules and packages.

Links#

Related

Python Package
·223 words·2 mins
Posts Essential 101 python
Fundamental building block for Python package.
Use of f-string format() in Python
·242 words·2 mins
Posts 101 python
Using f-string in Python.
Why __name__ == '__main__'?
·323 words·2 mins
Posts Essential 101 python
Wonder why we always start with if __name__ == '__main__': in Python?