So I am writing a program for school, and I have to make a maths quiz, the quiz needs to be out of 10 questions.  I have made a button that is defined with a command that generates a new questions, clears the text box, get the answer from the dictionary, and inserts the new question into the textbox.  At the moment the user can press the button as many times as they want.  I dont actually know how to count or monitor the amount of times a button in tkinter has been pressed.  I would be very grateful if someone could provide me with some code for Python(3.1.4) that I could use to count the amount of times the button has been pressed.
You need a variable in a global or class instance scope and a function that has access to the scope of the variable that increments the variable when called.  Set the function as the command attribute of the Button so that the function is called when the button is clicked.
How to count the number of times a button is clicked Python(tkinter)