title: How to remove file when program exits?
body: <p>Is there a way to register a file so that it is deleted when Python exits, regardless of how it exits?  I am using long-lived temporary files and want to ensure they are cleaned up.</p>
  <p>The file must have a filename and it's original handle should be closed as soon as possible -- there will be thousands of these created and I need to ensure they exist only as normal files.</p>