๐ŸŽ New User? Get 20% off your first purchase with code NEWUSER20 ยท โšก Instant download ยท ๐Ÿ”’ Secure checkout 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

Pickle
Python's built-in module for serializing and deserializing Python objects into a byte stream for storage or transmission.
Django
A high-level web framework that follows the batteries-included philosophy, providing ORM, admin, auth, and more out of the box.
Pytest
A testing framework for Python that simplifies writing and running tests with powerful features like fixtures and parametrize.
Type Hints
Optional annotations that indicate the expected types of variables, function parameters, and return values.
Decorator
A function that modifies or extends the behavior of another function or class without changing its source code.
Docstring
A string literal placed as the first statement in a module, class, or function to document its purpose and usage.
View All Python Terms โ†’