概述
我想通过一个按钮在Python中重新加载Tkinter窗口,但我很难搞清楚它。你会发现,它使用import random并随机生成来自列表的单词,当你点击按钮时,我想将标签设置为不同的单词,就像滚动的骰子,但用单词。如何在Python中“刷新”Tkinter窗口?
import random
from Tkinter import * #don't import like this except for Tkinter
root = Tk() #create main window
root.title('Atarashi Sozo')
# Make and place a canvas widget for events and drawing
canvas = Canvas(root, height=600, width=600, relief=RAISED, bg='white')
canvas.grid() #Puts the canvas in the main Tk window
#Create lists
creature = ['is an Animal', 'is a Human', 'is an Artificial Intelligence',
'is an Alien', 'is a Mage','is a Reptillian','is a Shapeshifter',
'is Undead', 'is a Scorpion Hedgehog', 'is an Angel', 'is a Demon']
element = ['controls lightning&#
最后
以上就是怕孤单豌豆为你收集整理的python 窗口更新_如何在Python中“刷新”Tkinter窗口?的全部内容,希望文章能够帮你解决python 窗口更新_如何在Python中“刷新”Tkinter窗口?所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复