python - Python中的退出代码

我收到一条消息说 script xyz.py 返回了退出代码 0。这是什么意思?

Python 中的退出代码是什么意思?那里有多少?哪些重要?

最佳答案

您正在寻找调用 sys.exit() 的电话在脚本中。该方法的参数作为退出代码返回给环境。

脚本很可能从未调用 exit 方法,而 0 是默认退出代码。

https://stackoverflow.com/questions/285289/

相关文章:

python - 在 NumPy 中将索引数组转换为 one-hot 编码数组

linux - 如何阅读 shell 命令的源代码?

linux - 在一行中从 linux 终端发送邮件

linux - 在 SSH session 中查找客户端的 IP 地址

python - 如何为类对象创建自定义字符串表示?

python - 遍历列表中的每两个元素

linux - 什么是不间断进程?

python - 在 Python 中创建具有初始容量的列表

Python 函数属性 - 使用和滥用

linux - 在 linux 中显示磁盘事件的类似 htop 的工具