python系统出口()错误builtins.SystemExit:

2024-04-25 07:33:28 发布

您现在位置:Python中文网/ 问答频道 /正文

import sys
def main():
    keystr = input("Enter the Key: ")
    key = int(keystr)
    if (key <=0) or (key>=25):
        print("The key is out of range")
        sys.exit()

当我想用键的输入(<;=0或>;=25)终止时,有一个错误消息。在

^{pr2}$

我怎样才能修好它? 错误显示,我在空转状态下运行这个程序。如果在终端上,它工作得很好。在


Tags: orthekeyimportinputifmaindef

热门问题