Python: Object destruction upon terminal close
<p>I need to create a code that would be flexible enough to perform some required cleanups even if the terminal where it was running is closed or SSH connection is lost. I have all the necessary code wrapped into one class' <code>__del__</code> method. However, Python doesn't seem to be calling it (unlike C++) on exit. I tried <code>[atexit][1]</code> but it wasn't called either.</p>

<p>Any suggestions will be appreciated.</p>
