Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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', "Hello
")
txt.insert('end', "Alert #1
", 'warning')
txt.insert('end', "World
")
txt.insert('end', "Alert #2
", 'warning')

root.mainloop()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #change #font #line
ADD COMMENT
Topic
Name
3+9 =