"Torsten Bronger" <bronger at physik.rwth-aachen.de> wrote in message news:m34qby1kaq.fsf at bob.ipv.kfa-juelich.de... >Is there a way to detect whether the program is being terminated? See atexit module to register cleanup functions that run *before* the interpreter starts haphazardly deleting stuff. Terry J. Reedy