How can a person create a package in python IDLE?
How can we person create a package in python IDLE?
What is Python?
Python is a popular programming language. It was created by Guido van Rossum, and released in 1991.
It is used for:
- web development (server-side),
- software development,
- mathematics,
- system scripting.
What is a package in python :
A package is basically a directory containing Python files and a file named __init__. py. This means that every directory in the Python path contains a file named __init__. py will be treated as a package by Python.
To create packages in python we need to do follow 3 simple steps:
1. Firstly we create a directory file and gives its package name.
2. Then we put the classes and required functions in it.
3. Finally we create an __init__.py file inside the directory because python knows the directory is a package.
Comments
Post a Comment