我是靠谱客的博主 怕孤单豌豆,这篇文章主要介绍python 窗口更新_如何在Python中“刷新”Tkinter窗口?,现在分享给大家,希望可以做个参考。

我想通过一个按钮在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内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(115)

评论列表共有 0 条评论

立即
投稿
返回
顶部