Sunday 24 September 2017

Python Module, Package or Library

Cited from Modules vs Packages vs Libraries in Python

A module in python is a .py file that defines one or more function/classes which you intend to reuse in different codes of your program.

To reuse the functions of a given module you simply need to import the module using:

import <modulename> # to import the entire module

from <modulename> import <classname> # imports a class from a module

No comments:

Post a Comment