Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Tk_select_font_recolor.py
- from tkinter import *
- root = Tk()
- text = Text(root)
- text.insert(INSERT, "Hello, World!\n")
- text.insert(END, "This is a phrase.\n")
- text.insert(END, "Bye bye...\n")
- text.pack(expand=1, fill=BOTH)
- # adding a tag to a part of text specifying the indices
- text.tag_add("start", "1.7", "1.13")
- text.tag_config("start", background="blue", foreground="yellow")
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement