Difference between exit(0) and exit(1) in Python

前端 未结 5 1551
没有蜡笔的小新
没有蜡笔的小新 2020-11-29 16:27

What\'s the difference between exit(0) and exit(1) in Python?

I tried looking around but didn\'t find a specific question on these lines. I

5条回答
  •  借酒劲吻你
    2020-11-29 17:23

    This determines the exit status of the program when it finishes running (generally, 0 for success and 1 for error).

    It is not unique to Python, and the exact effect depends on your operating system and how the program is called (though 99% of the time, if you're just running Python scripts, it doesn't matter).

提交回复
热议问题