O'Reilly logo

Python Essential Reference, Second Edition by David M Beazley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Python Services

The modules in this section are primarily used to interact with the Python interpreter and its environment.

atexit

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 ).

Note
  • The atexit module should be used instead of setting the sys.exitfunc variable.

See Also sys (116).

copy

The copy module provides functions for making shallow and deep copies of compound objects, including lists, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required