Please help me in clarifying the concept of these two python statements in terms of difference in functionality:
sys.exit(0)
os._exit(0)
According to the 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 a fork().
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 a fork().
sys.exit(n)
_exit()
fork()
1.4m articles
1.4m replys
5 comments
57.0k users