On Apr 10, 1:15 pm, "Yujo" <[EMAIL PROTECTED]> wrote: > Hello everybody, > > In the following code of the finish() function, is there any way to > get the exit code passed to sys.exit() ? > > def finish() : > RETURN_CODE_FROM_SYS_EXIT = ???? # how can I get it ? > if RETURN_CODE_FROM_SYS_EXIT = 0 : > # process ended OK > else : > # process ended with some error > # execute something > > atexit.register(finish) > > # this is my main program.... > > ERR_CODE=3 > sys.exit(ERR_CODE) > > Regards, > > Yujo
I'm not sure if this will help or not, but this article is pretty enlightening and is written by a well-known Pythonista: http://www.artima.com/weblogs/viewpost.jsp?thread=4829 Here is another older post with helpful information: http://www.daniweb.com/techtalkforums/thread31226.html And here's a hack that might work: http://www.daniweb.com/techtalkforums/thread31166.html Mike -- http://mail.python.org/mailman/listinfo/python-list