Importing a module

In python, in order to use a module, it has to be imported. Python provides multiple ways to import modules in a program : 
 

  1. To import the entire module : 
import module_name
  1. To import only a certain portion of the module : 
from module_name import object_name
  1. To import all the objects of the module : 
from module_name import *

 

Basics Of Python Modules

A library refers to a collection of modules that together cater to a specific type of needs or application. Module is a file(.py file) containing variables, class definitions statements, and functions related to a particular task. Python modules that come preloaded with Python are called standard library modules. 
 

Similar Reads

Creating our module

We will be creating a module named tempConversion.py that converts values from F to C and vice-versa....

Importing a module

...

Using an imported module

In python, in order to use a module, it has to be imported. Python provides multiple ways to import modules in a program :...

Python standard library functions

After importing the module, we can use any function/definition of the imported module as per the following syntax:...