我正在编写一个测试程序来测试python中的一些东西,我似乎无法找到一种方法来结束程序并关闭python窗口。 这是我的代码:有没有办法使用python关闭python窗口?
yesorno = input('If you want to start the program, type yes, if not type
no')
def cls(): print('hello')
cls()
if yesorno == 'y':
del yesorno
elif yesorno == 'n':
print("you chose wrongly.")
任何帮助是非常赞赏。
**进口SYS ** ** 进口时间**可以帮助您在这个 –
您可以使用SYS .exit()终止程序。 –