The following is a method in a particular class that creates a simple calculator in python. It's intended to wait for a button to be clicked and return the label of that that button:
def getButton(self):
while True:
p = self.win.getMouse()
for b in self.buttons:
if b.clicked(p):
return b.getLabel()
The self.buttons variable is a list of all the calculator buttons. Clicked is a method that checks if the button has been clicked. What I don't understand is the "while True" boolean while loop. What is it testing to be true or false? In what case will the it not be true?