Hinted text widget for tkinter.
This custom HintedText class inherits from tk.Text and adds a hint parameter in the constructor. The clear_hint method is bound to the <FocusIn> event and will clear the hint text if the widget has focus and the text is the same as the hint. The add_hint method is bound to the <FocusOut> event and will add the hint text back if the widget loses focus and the text is empty.
pip install hintedtextimport tkinter as tk
from hintedtext import HintedText, HintedEntry
root = tk.Tk()
text = HintedText(root, hint="Enter your text here")
text.pack()
entry = HintedEntry(root, hint="Enter your text here")
entry.pack()
root.mainloop()