Making a GUI Calculator in Python with Tkinter
Posted on 2009-02-21
i'm just starting out with python today, and am trying to make a basic calculator program in Python with the Tkinter gui module.
At the moment I have the buttons 1-9 and each one calls a separate function, i.e. OnButtonClick1, OnButtonClick2, etc.
However since they all basically do the same thing, and only the number is different, there must me an easier way to do this?
Is there any way that I can just have one function such as OnButtonClick which can determine which button was pressed and do its logic based on that?