July 2009
Intermediate to advanced
744 pages
20h 2m
English
This chapter describes modules that are related to the Python interpreter runtime. Topics include garbage collection, basic management of objects (copying, marshalling, and so on), weak references, and interpreter environment.
atexitThe 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). Upon exit, functions are invoked in reverse order of registration (the most recently added exit ...
Read now
Unlock full access