Bye Bye Moore

PoCソルジャーな零細事業主が作業メモを残すブログ

atexitモジュールはスクリプト終了処理を記述可能

標準添付のatexitモジュールはプロセス終了時の動作を記述かのうです。
もう末尾にやっつけ終了処理を書かなくても良いのです(涙

実際のところ

import atexit

@atexit.register
def end():
   print("Done:The Process")

print("first")
$ python test_exit.py 
first
Done:The Process