♦ Python Modules
♣ About Python Modules
Python Modules are embedded packages which contain pre-defined Classes and Methods which can be used upon importing.Python Modules come in very handy as to combine all the Methods and Classes of a particular type and distribute whenever needed.
♣ Official Python Modules
Community define some packages and after some formalities, if the package is good enough and follow the policies of Python, then can be uploaded to Official Python Server as Modules.This Modules can be installed on local machine by using
♣ Custom Python Modules
Every file with extensionpy
is a custom module and can be used as Module Locally.This Modules cannot be installed globally through
♣ Installating Python Module
Below is the representation of syntax for python module installation.Basic Syntax
pip install module_name
Syntax Explanation:
module_name: name of the module to be installed, and should be globally availabe(on Python's official website)
♣ Un-Installating Python Module
Below is the representation of syntax for python module un-installing.Basic Syntax
pip uninstall module_name
Syntax Explanation:
module_name: name of the module to be un-installed
♣ Example1: import Python Module
In this example, "numpy" module will be imported. Example
Input:
Output:
♣ Example2: import from module Python
In this example, "max" will be imported from "numpy" module. Example
Input:
Output:
♣ Example3: import as Python Module
In this example, "max" will be imported as "mx" from "numpy" module. Example
Input:
Output: