My daughter and I are trying to create a small Python GUI and we cannot get the image on each of the 3 buttons to appear or for the 3 buttons to become "clickable".
When you open the GUI there is a single input box and a Next button. Users type an input and click "Next". They do this up to Question 11 (everything up to this point works as expected). When you get to Question 11, there are 3 blank buttons, 2 of which are pushed together. We would like all 3 buttons equally spaced out with the required image in each.
We have spent hours and hours trying to fix it but have not been successful. When we put the code into Chat GPT this is what it has to say:
Button1Press, Button2Press, Button3Press
----------------------------------------
The same variable names are defined at the top and bottom the script. The top or bottom ones need different names.
photo2 = tkinter.PhotoImage(file = "newholland.png")
----------------------------------------------------
photo2, photo3, photo4 need to be defined as global variables so they don't get garbage collected.
button1, button2, button3
-------------------------
Need to be defined as global variables.
So we are basically looking for someone to fix the bug issue with the 3 buttons and "tidy up the code" so when it runs, there are zero errors in the error log. Also, in the bottom left corner, there is a "Score Count", we would also like this to work. Currently, when the user gets their first question right, it adds 2 points rather than 1 point to the score count and after that it then works correctly.
We have attached the Python script and in a zip file there are the associated images so you can get a better idea on what we require.
... Show more