0

I'm new to TkInter and using Python to develop UI. So as a way of step-by-step learning, I'm just trying to get a window. I wrote the following simple code:

from Tkinter import Tk

window = Tk()
window.geometry("266x208")
window.title("Claculator")

I'm expecting an empty window that pops up when I run the code, but I get noting. Just Process finished with exit code 0. What am I missing?

PS: Python 2.7, Windows 7

2 Answers 2

8

You didn't do a

window.mainloop() 

at the end. Check the Tkinter docs tkinter docs for more help.

Sign up to request clarification or add additional context in comments.

Comments

2

At the end of your code, just add window.mainloop(). This tells tkinter that the form is ready and it can be shown to the user.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.