小编Gra*_*061的帖子

如何更改 Tkinter 中文本的颜色?

我无法弄清楚如何更改 Tkinter GUI 中文本的颜色。我试图让 Label1 为红色,Label2 为蓝色,Label3 为棕色,Label4 为黄色,但我似乎无法弄清楚。提前致谢 :)

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 …
Run Code Online (Sandbox Code Playgroud)

python text tkinter colors

3
推荐指数
1
解决办法
3万
查看次数

标签 统计

colors ×1

python ×1

text ×1

tkinter ×1