0

Let's imagine, I have a simple tkinter program: only tkinter.Entry(), where I can write down some text. The main goal I have set to this tkinter.Entry() is to make next: when I try to input there some symbol, it is immediately deleted from tkinter.Entry(). So the question is how to make tkinter.Entry() delete every symbol, when it have been just input there?

I hope the problem is fully described. Thanks in advance for your help.


I apologize, but it seems to me that this question has lost its former relevance for me. Sorry for letting you take all of your precious time. I took all the answers and tips into account. I will delete the question soon. Thank you for your attention to me

dude
  • 1
  • 1
  • 1
    Please [edit] your question to include a [mcve]. Also, if you are trying to do this through bindings you might want to check out this answer, which describes how events are processed: https://stackoverflow.com/questions/11541262/basic-query-regarding-bindtags-in-tkinter/11542200#11542200 – Bryan Oakley Feb 03 '21 at 18:31
  • It's not clear what you want to do. Do you want to reject certain symbols that are typed into an Entry but accept others? – Tls Chris Feb 03 '21 at 19:46
  • I'm sorry it's still not clear. I can find at least two interpretations. You want to enter some text into an Entry. Then either 1) You want to stop all further text being entered by deleting each symbol as it's entered, leaving what is already in the Entry. OR 2) You want to delete ALL the text in the Entry after a certain point. Whichever is the correct interpretation what would cause the behaviour to change from entering text to deleting text – Tls Chris Feb 03 '21 at 22:32
  • I apologize, but it seems to me that this question has lost its former relevance for me. Sorry for letting you take all of your precious time. I took all the answers and tips into account. I will delete the question soon. Thank you for your attention to me. – dude Feb 03 '21 at 23:05

1 Answers1

1

From what I deduced, you're trying to delete the content from the entry widget.
tkinter.Entry.delete('0',END)
This should do it.

Dude901
  • 153
  • 1
  • 9
  • yeah, I tried it. But it isn't work properly. Just pressed key on keyboard is on the left side of the cursor and this only one symbol is already stays. – dude Feb 03 '21 at 18:08
  • Can you add the code for more clarification, and if possible, add the screenshots of the entry widget before and after the delete command is executed. – Dude901 Feb 03 '21 at 18:11
  • I apologize, but it seems to me that this question has lost its former relevance for me. Sorry for letting you take all of your precious time. I took all the answers and tips into account. I will delete the question soon. Thank you for your attention to me – dude Feb 03 '21 at 23:05