I would like to use only one function (self.toggle) for all of my buttons in my GUI instead of doing each for every button. I have tried to change name of self.button only without numbers and then I had text changing on just one button not the one required. Is there simple way to do just one function? I’m just
Tag: tkinter
Why is no error showing up when inserting a name that is not in the table sql/python
The problem that I am refering to is that if you insert something random in the USER_INP variable that is not in the database, it doesn’t show an error like THIS DOES NOT EXIST IN THE TABLE or something like that. What I want to achieve is when the user inserts something random in the USER_INP variable, the last message
How to detect which key was pressed on keyboard/mouse using tkinter/python?
I’m using tkinter to make a python app and I need to let the user choose which key they will use to do some specific action. Then I want to make a button which when the user clicks it, the next key they press as well in keyboard as in mouse will be detected and then it will be bound
Tkinter destroying an object in a different function isn’t working
I’m trying to make a button that saves your username but then goes away after you set it. this is my code: Answer The code below, with some minor changes like enabling change with [Return] and some layout cosmetics works OK (also with un-commented lines in printValue) . If you want the [Change] button and the entry area to go
how to stop tkinter timer function when i press button one more times?
i’d tried to use root.after_cancel(AFTER), but i dont know how. Answer It’s hard to guess what actually you are after, but … below working code which outputs to stdout and is able to start/stop/restart the countdown with pressing the [Countdown] button. The ‘trick’ is to run the timer all the time checking a value of a global variable, where pressing
Right number of letters are not appearing in python tkinter game
I am trying to create a jumbled word but the right amount of letters are not showing when running the code. There’s only 1 letter being displayed and if the user actually inputs the right answer, the code only takes it as a wrong answer. Is there a way to fix this problem? Thank you! Answer O lord how many
Python Tkinter widgets not showing when parent is self only root why?
I am making a GUI and this is the same exact code from another project were the widgets show up when self is their parent. But for some reason in this script they only will show if root is set as parent why? The Image Label does not show but the frame does and vice versa if I switch the
How to check a text editor (file) for the presence of a certain word that the user entered
There is a variable email = String Var() that transmits the entered login, I want to check through the open file whether the entered login is already in the text editor Users.txt ,but the compiler writes that it cannot read with the StringVar() data type, the question is that how can I convert the email variable so that open file
How to Display python script Error in Tkinter message box
I have written the below code for run a python file on button click through tkinter and also displaying two button for run python file on GUI window. Now my pyhton files is working fine when click on button. But there is one issue is I want to shows error on tkinter error box whatever error shows on cmd window.
Why can’t I bind the control key and plus key to a Tkinter text widget in Python?
Basically I wanted to bind two keys to a text widget those keys are the control key and the plus key. This is what I tried: This for whatever reason doesn’t work. It doesn’t go to my function and it doesn’t return any errors if you were wondering. But for some other reason this works: Why is this? And how