First, you have to have a Tk instance before you do anything else. Take a look at this example, and then expand upon it to create the calculator http://python-textbok.readthedocs.io/en/1.0/Introduction_to_GUI_Programming.html