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


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
.


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM