Answers for "python change font in 1 line"

0

python change font in 1 line

import tkinter as tk

root = tk.Tk()

txt = tk.Text(root)
txt.pack()

txt.tag_config('warning', background="yellow", foreground="red")

txt.insert('end', "Hellon")
txt.insert('end', "Alert #1n", 'warning')
txt.insert('end', "Worldn")
txt.insert('end', "Alert #2n", 'warning')

root.mainloop()
Posted by: Guest on February-04-2022

Python Answers by Framework

Browse Popular Code Answers by Language