The modules in this section are primarily used to interact with the Python interpreter and its environment.
The atexit module is used to register functions to execute when the Python interpreter exits. A single function is provided:
register(func [, args [, kwargs]])
Adds function func to a list of functions that will execute when the interpreter exits. args is a tuple of arguments to pass to the function. kwargs is a dictionary of keyword arguments. The function is invoked as func (*args ,**kwargs ).
The atexit module should be used instead of setting the sys.exitfunc variable.
▸ See Also sys (116).
The copy module provides functions for making shallow and deep copies of compound objects, including lists, ...