A package is basically a directory with Python files and a file with the name __init__.py.
This means that every directory inside of the Python path, which contains a file named __init__.py, will be treated as a package by Python.
It’s possible to put several modules into a Package.
Program code:
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.
__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.
Python Libraries and modules are demonstrated in above program.
To view all the lessons in chapter 1: http://computertutor.in/class-12-computer-science/chapter-4/
To view entire class 12 computer science study material: http://computertutor.in/resources/
You cannot copy content of this page