请帮助我澄清这两个 python 语句在功能差异方面的概念:
sys.exit(0)
os._exit(0)
最佳答案
根据documentation :
os._exit():
Exit the process with status n, without calling cleanup handlers, flushing stdio buffers, etc.
Note The standard way to exit is
sys.exit(n)
._exit()
should normally only be used in the child process after afork()
.
关于python - sys.exit(0) 和 os._exit(0) 有什么区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9591350/