Modules

A module is a file consisting of Python code that can define functions, classes and variables.

You can use any Python source file as a module by executing an import statement.

import datetime
Python's from statement lets you import specific attributes from a module into the current namespace.
from datetime import datetime, timezone
from json.encoder import JSONEncoder
import * statement can be used to import all names from a module into the current namespace.
from datetime import *