🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

Python Beginner

What is Module?

A Python file containing definitions and statements that can be imported and reused in other Python programs.

A module is simply a .py file. It can define functions, classes, and variables. Modules promote code reuse and organization. Import with import module_name or from module import function.

Python comes with a rich standard library of modules (os, sys, json, datetime, etc.). Third-party modules are installed via pip. Packages are directories of modules with an __init__.py file.

Related Terms

Pip Requirements File
A text file listing Python package dependencies with version specifications for reproducible project installations.
Comprehension
A concise syntax pattern for creating collections by transforming and filtering items from iterables.
Python Profiling
Measuring where Python code spends time and memory to identify performance bottlenecks and optimization opportunities.
Python Typing Module
A standard library module providing type hints for function signatures and variables, enabling static analysis without runtime enforcement.
Pathlib
A modern Python module providing an object-oriented interface for filesystem paths, replacing os.path operations.
Dictionary
A built-in data structure that stores key-value pairs with O(1) average lookup time using hash tables.
View All Python Terms →