What are modules in python?
Python modules are files, containing already written codes or programs. Which can be used directly in your python program. A module can be written in any programming languages to perform specific task .
Types of modules.
There are two types of modules in python :
- Built-in modules
- External modules
Built-in modules
These modules are pre installed modules. It means when you install python, these modules are also installed with python, so it is known as built-in module of python.
List of some useful built-in modules :
- os
- sys
- random
- abc
- time
- math
- json
- csv
- copy
- datetime
Using built-in modules
To use a built-in module, you have to write import module_name . For example "import os".
External modules
These modules need to be installed externally. which is downloaded from the internet using pip.
List of some useful external modules :
- pygame
- tensorflow
- django
- numpy
- flask
- pandas
- tkinter
- matplotlib
- scipy
- pyglet
Using external modules
To use a external module, you have to write same thing import module_name . For example "import pygame", but here it shows "no module found" because we haven't installed the "pygame module". This problem can be solved by using pip. Here is a detailed post on pip "Python Pip".
Which module is used in web development. Tell your answer in comment section.
Comments
Post a Comment