【发布时间】:2022-12-06 05:51:37
【问题描述】:
我想以 10 种不同的随机颜色插入我的文本,但 tag_configure 仍然保存第一种颜色,它向我展示了 10 种使用相同第一种颜色的打印。 我认为问题出在名字上。
def write10(affich):
for i in range(11) :
color = '#'+("%06x"%random.randint(0,16777215))
print(color)
my_text2.tag_configure('name', background = color)
my_text2.insert(0.2,affich,"name")
【问题讨论】:
标签: python user-interface tkinter tkinter-canvas tkinter-entry