Python standard library

Python exposes many built-in functions through its PythonStandard library.

The standard library is a huge collection of various utilities, ranging from math utilities to debugging to creating graphical user interfaces.

You can find a complete list of standard library modules here:https://docs.python.org/3/library/index.html

Some important modules are:

  • mathUsed for math tools
  • reUsed in regular expressions
  • jsonUse JSON
  • datetimeWork with date
  • sqlite3Use SQLite
  • osFor operating system utilities
  • randomUsed for random number generation
  • statisticsUsed in statistical utilities
  • requestsPerform HTTP network request
  • httpCreate HTTP server
  • urllibManage URL

Let us introduce howuseModules of the standard library. You already know how to use the created module and import it from other files in the program folder.

Well, this is the same module provided by the standard library:

import math

math.sqrt(4) # 2.0

or

from math import sqrt

sqrt(4) # 2.0

We will soon explore the most important modules individually to understand what we can do with them.


More python tutorials: