Other Standard Library Modules
This section documents a handful of additional standard library modules. See the Python Library Reference for details on all built-in tools, and the PyPI websites (described in Assorted Hints) or your favorite web search engine for third-party modules and tools.
The math Module
math module exports C standard math library
tools for use in Python. Table 1-25 lists this module’s
exports; see the Python Library Reference for more details. Also see
cmath module in the Python
library for complex number tools and the NumPy system for advanced numeric
Table 1-25. math module exports in Python 3.0 and 2.6
The time Module
Following is a partial list of
time module exports. See the Python Library
Reference for more details.
Returns the CPU time or real time since the start of the process or since the first call to
clock(). Precision and semantics is platform-dependent (see Python manuals). Returns seconds expressed as a floating-point number. Useful for benchmarking and timing alternative code sections.
Converts a time expressed in seconds since the epoch to a string representing local time (e.g.,
ctime(time())). The argument is optional and defaults to the current time if omitted.
Returns a floating-point number representing UTC time in seconds since the epoch. On ...