简体   繁体   English

我可以关闭 python 程序而不给我一个弹出窗口吗?

[英]Can I have a python program close wihtout giving me a popup?

At the end of one of my programs, I put the following code:在我的一个程序的末尾,我输入了以下代码:

print('Thank you for using this program!')
print('Goodbye')
time.sleep(10)
exit()

I did this to give the user some time to read the text, and then have the window close.我这样做是为了给用户一些时间来阅读文本,然后关闭 window。 However, this has been giving me the following popup:但是,这给了我以下弹出窗口:
图片 . .

Is there any way I can have the window close without giving me this popup?有什么方法可以关闭 window 而不给我这个弹出窗口?

Use 'import sys' then exit using 'sys.exit()'使用 'import sys' 然后使用 'sys.exit()' 退出

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM