我在Tkinter中有一个按钮,作为游戏中的第一个按钮,所以我想让它启动游戏,同时破坏自己,这样玩家就可以开始玩了,但我似乎无法让它工作。
这是我迄今为止的代码,非常感谢您的帮助:
from tkinter import *
from random import seed
from random import randint
from tkinter import font as font
import time
root = Tk()
myFont = font.Font(size=25)
root.title("Python Guessing Game")
root.geometry("600x600")
ready = False;
if ready == True:
print('Hello! What is your name ?')
destroyBtn()
button_start = Button(root, text="Start Game", font=myFont, bg='#0052cc', fg='#ffffff', command=ready
= True, height=1, width=20).place(relx=0.5, rely=0.5, anchor=CENTER)
def destroyBtn():
button_start.destroy()
您好,我已经编写了一个我相信您正在寻找的快速示例。如果这不能解决这个问题,请扩大你正在寻找的
相关问题 更多 >
编程相关推荐