🎁 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

NumPy
A fundamental library for numerical computing in Python, providing efficient multi-dimensional arrays and mathematical operations.
Pydantic
A data validation library that uses Python type annotations to validate and serialize data with automatic error reporting.
Python Package
A directory containing Python modules and an __init__.py file, providing a way to organize and distribute reusable code.
Python Profiling
Measuring where Python code spends time and memory to identify performance bottlenecks and optimization opportunities.
Python Descriptors
Objects that define __get__, __set__, or __delete__ methods, controlling how attribute access works on other objects.
Python Typing Module
A standard library module providing type hints for function signatures and variables, enabling static analysis without runtime enforcement.
View All Python Terms →