1

I have a text widget

import tkinter as tk

root = tk.Tk()

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

text_box.tag_config("tag-center", justify="center")
text_box.insert("end", "22", "tag-center")

root.mainloop()

but when I select I have this

enter image description here

but I want select only text

  • Does this answer your question? [Stripping non printable characters from a string in python](https://stackoverflow.com/questions/92438/stripping-non-printable-characters-from-a-string-in-python) – ThePyGuy Jun 11 '21 at 13:50
  • @Don'tAccept That isn't OP's question. Their problem is that when you select text in a `tkinter.Text`, it doesn't only select the text. This happens when the text is centered. – TheLizzard Jun 11 '21 at 13:57
  • So what me doing –  Jun 11 '21 at 14:01
  • This question requires clarification. You just don't like the look of the widget when you select text? – 8349697 Jun 11 '21 at 16:33

0 Answers0