独立于平台的出口代码。
exit-codes的Python项目详细描述
< H2> EXITY代码
独立于平台的退出代码。
Python为一些平台提供了标准的退出状态代码,但不是全部。这个 在技术上,学究上是正确的,但是提供 实用的跨平台退出状态。此包采用退出状态代码 在os中为unix定义,并使它们对未清洗的群众可用。
使用起来很简单:
fromexit_codesimportExitCodedefmain():ifbig_operation():# If your program exits normally, return OKreturnExitCode.OKelse:# Otherwise, return the appropriate error codereturnExitCode.IO_ERR