MODULES
A module is a file containing code written by somebody else (usually) which can be imported and used in our program.
Examples Of Some Modules Are:
- os
- flask
- tkinter
- pygame
- tensorflow, etc.
Types Of Modules
There are two types of modules. These are:
- Built-in modules - Pre-installed in Python
- External modules - Need to install using pip
Some examples of built-in modules are os, tkinter, etc.
Some examples of external modules are flask, tensorflow, etc.
PIP
Pip is the package manager for python. You can use pip to install external modules on your system. Command to install a module using pip is pip install _Module Name_. For example:
pip install tensorflow installs tensorflow module.
Steps To Install a Module are:
- Open Command Prompt
- type pip install _Module Name_
It will start installing the module so it can take some time.
Using Python as a Calculator
We can use python as a calculator by typing “python” + TO DO on the terminal. [It opens REPL or read evaluation print loop]
With this our second third chapter is over.
0 Comments