您的位置:首页 > 编程语言 > Python开发

python os._exit(0) and sys.exit(0)

2013-07-24 08:58 375 查看
os._exit(n)

Exit to the system with status n, without calling cleanup handlers, flushing stdio buffers, etc. Availability: Macintosh, Unix, Windows.

Note: The standard way to exit is
sys.exit(n)
. _exit() should normally only be used in the child process after a fork().

sys.exit(n)
Exit from Python. This is implemented by raising the SystemExit exception, so cleanup actions specified by finally clauses of try statements are honored, and it is possible to intercept the exit attempt at an outer level
.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: