Difference between Module and Package?

module is look like package ??

2 Likes

Nope , In programming, a module is a piece of software that has a specific functionality. For example, when building a ping pong game, one module would be responsible for the game logic, and
another module would be responsible for drawing the game on the screen. Each module is a different file, which can be edited separately.

Packages are namespaces which contain multiple packages and modules themselves. They are simply directories, but with a twist.

Each package in Python is a directory which MUST contain a special file called __init__.py . This file can be empty, and it indicates that the directory it contains is a Python package, so it can be imported the same way a module can be imported.

2 Likes

Thank You @rajatkhatri0002

1 Like

https://stackoverflow.com/questions/7948494/whats-the-difference-between-a-python-module-and-a-python-package#:~:text=A%20package%20is%20a%20collection%20of%20Python%20modules%3A%20while%20a,a%20bunch%20of%20Python%20scripts.
For an in depth explanation

1 Like