如何注册要在退出时运行的函数?(How can I register a function to be ran at exit?)
如果python解释器出于某种原因存在,是否有办法注册要运行的函数“logout”?
Is there a way to register a function "logout" to be ran if the python interpreter exists for some reason or another?
最满意答案
如上所述,来自python的stdlib的atexit就是这样做的
As commented above, atexit from python's stdlib does it
更多推荐
发布评论