php equivalents?

Daniel Dittmar daniel at
Fri Apr 25 00:34:50 CEST 2003

Kevin Howe wrote:
> Thanks for the suggestions Daniel. I've since discovered an equivalent to
> PHP's register_shutdown_function() as follows:
> def myFunc ():
>   """ perform cleanup just before the script exits """
> import atexit
> atexit.register(myFunc)

If you're doing straight CGI, then atexit will work. But I guess if 
you're using the Apache module or anything with fastcgi, then the atexit 
functions won't be called at the end of the request but only when the 
Python interpreter is shut down. Which may or may not be exactly what 
you want.


More information about the Python-list mailing list