Python Modules

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 :
  1. Built-in modules
  2. 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 :

  1. os
  2. sys
  3. random
  4. abc
  5. time
  6. math
  7. json
  8. csv
  9. copy
  10. 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 :

  1. pygame
  2. tensorflow
  3. django
  4. numpy
  5. flask
  6. pandas
  7. tkinter
  8. matplotlib
  9. scipy
  10. 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