在更新Python启动器之前,Messagebox不会被删除

时间:2018-10-06 12:36:06

标签: python tkinter

我在运行macOS Mojave(版本3.5.0)的Mac上运行Python程序。我试图使tkinter窗口在消息框关闭后出现,但是除非我通过单击扩展坞中的图标来更新Python启动器,否则它不会出现,并且与此没有任何问题。

import tkinter as tk
from tkinter import messagebox

players = 2
choices = []

# getting rid of dummy windows.
window = tk.Tk()
window.withdraw()

for i in range(players):
    player_id = i + 1
    result = messagebox.askyesno("Account Settings", "Player " + str(i + 1) + "," " would you like to sign in?")
    choices.append((player_id, result))

window.destroy()

window = tk.Tk()
button = Button(window, text="Please click me", command=lambda: print("clicked!"))
button.pack()
window.mainloop()    

def get_choices():
    return choices

您的任何意见都会受到赞赏。

0 个答案:

没有答案