Как я могу изменить цвет текста в Python?Python

Программы на Python
Anonymous
Как я могу изменить цвет текста в Python?

Сообщение Anonymous »

Я делаю боевую игру на тему ведьмака для школьного проекта и не могу понять, как изменить цвет текста.
мой код:

Код: Выделить всё

from tkinter import *
import random

root = Tk()

background = PhotoImage(file = 'background.png')
win_screen_image = PhotoImage(file = 'win_screen.png')
lose_screen_image = PhotoImage(file = 'lose_screen.png')

def introductionCanvas():
intro_screen = Canvas(root, height = 720, width = 1280)
intro_screen.create_image(0, 0, image = background, anchor = 'nw')
intro_screen.pack()
intro_text = intro_screen.create_text(240, 80, font = 'Calibri 18', text = '     Welcome, Witcher\nPlease Enter Your Name:', )

introductionCanvas()
root.mainloop()
Я пытался использовать tag_configure, но затем мне пришлось изменить .create_text на intro_screen = Text(root, ...), и я не мог понять, как добавить фактический текст без ошибок.

Подробнее здесь: https://stackoverflow.com/questions/752 ... -in-python

Вернуться в «Python»