如何删除 Python IDLE 中的 exit(0) 弹出窗口?

How to remove exit(0) pop-up in Python IDLE?

我正在尝试 运行 在 Python IDLE 上编写一些代码,但是当我使用 exit() 时,我收到了一个弹出窗口。我怎样才能删除这个弹出窗口?

print "hi"
exit(-1)

使用 sys 模块中的 exit()

import sys

# your cool code here

sys.exit(0) # stops the program without a pop-up

例如 if:

import sys

x = 2
if x > 1:
    print "x > 1"
    sys.exit()
else:
    print x