sys.exit([args])的参数解析The optional argument arg can be an integer giving the exit status (defaulting to zero), or another type of object. If it is an integer, zero is considered “successful termination” and any nonzero value is considered “abnormal termination” by shells and the like.意思就是参数为数字的时候,和 shell 退出码意义是一样的,sys.exit(2)和sys.exit(1)只是为了区分结束原因0 :成功结束1 :通用错误 2 :误用Shell命令