Module atexit
[hide private]
[frames] | no frames]

Module atexit

atexit.py - allow programmer to define multiple exit functions to be executed upon normal program termination.

One public function, register, is defined.

Functions [hide private]
 
_run_exitfuncs()
run any registered exit functions
 
register(func, *targs, **kargs)
register a function to be executed upon normal program termination
Variables [hide private]
  _exithandlers = [(<bound method _MainThread.__exitfunc of <_Ma...

Imports: sys


Function Details [hide private]

_run_exitfuncs()

 

run any registered exit functions

_exithandlers is traversed in reverse order so functions are executed last in, first out.

register(func, *targs, **kargs)

 

register a function to be executed upon normal program termination

func - function to be called at exit targs - optional arguments to pass to func kargs - optional keyword arguments to pass to func


Variables Details [hide private]

_exithandlers

Value:
[(<bound method _MainThread.__exitfunc of <_MainThread(MainThread, sta\
rted)>>,
  (),
  {}),
 (<bound method _MainThread.__exitfunc of <_MainThread(MainThread, sta\
rted)>>,
  (),
  {}),
...