我想通过一个按钮在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', 'controls fire', 'controls nature', 'controls water', 'controls mater',
'controls time', 'controls gravity', 'controls life', 'controls death', 'controls wind',
'can bend any metal','controls the sun', 'controls the moon', 'controls love']
features = ['has wings', 'has markings', 'has large fangs', 'has claws&