there is no exitfunc in sys module
Terry Carroll
carroll at tjc.com
Sat Jan 24 13:41:16 EST 2004
On Sat, 24 Jan 2004 00:07:53 -0800 (PST), Hameed Khan
<hameedkhaan at yahoo.com> wrote:
> i was reading the manual for sys module. i found a
> description for a function known as exitfunc. and it
> says the function installed by
> sys.exitfunc(cleanUpFunc) call will be called when the
> interpreter exits. but when i try to call this
> function on Python interactive prompt it says there is
> no attribute named exitfunc in sys module.
It doesn't exist by default. It's a function that you set up to be
called at termination. Try this::
import sys
def outtahere():
print "Okay, I quit"
sys.exitfunc=outtahere
print "program starting"
# do something
print "program done, now exiting"
More information about the Python-list
mailing list