Python 中的退出代码 [英] Exit codes in Python

查看:45
本文介绍了Python 中的退出代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I got a message saying script xyz.py returned exit code 0. What does this mean?

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

What do the exit codes in Python mean? How many are there? Which ones are important?

推荐答案

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

You're looking for calls to sys.exit() in the script. The argument to that method is returned to the environment as the exit code.

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

It's fairly likely that the script is never calling the exit method, and that 0 is the default exit code.

这篇关于Python 中的退出代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆