I want to remove every text inside < >. I used to replace('<*>',' ') but it does not remove them at all.
For example, my text is "<a/ddff>Nitin Hardeniya - 2015 - Computers"
I want it to turn into "Nitin Hardeniya - 2015 - Computers"
.
Please advise me on how should I correct my code.
Here is code:
import tkinter as tk
root = tk.Tk()
text = root.clipboard_get()
def onclick():
text_widget.delete("1.0", "end")
text_widget.insert(tk.END, text.replace('<*>',' '))
root = tk.Tk()
text_widget = tk.Text(root)
text_widget.insert(tk.END, text) #inserting the data in the text widget
text_widget.pack()
button = tk.Button(root, text = "Press me!", command = onclick)
button.pack()
root.mainloop()