What is the library? Write procedure to create own library in Python.

  • Library is collection of packages.
  • Library is similar to directory in system

Steps to create own library in python-

  1. Decide basic structure of package like name of package, module, sub-folders, sub-packages which will be part of it.
  2. Create the directory structure including folders, package name, sub packages.
  3. Inside main package folder create file/module i.e. .py files and sub-folders with their .py files.
  4. Create __init__.py file in package and sub-packages.
  5. Associate package with Python by attaching it Python’s site-folder of Python Installation.
  6. After attaching (copying) your package folder in site-package folder of your Python Installation it become a library.
error: Content is protected !!