我正在編寫一個測試程序來測試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()終止程序。 –