Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Tkinter Tk.quit causes hang

fimasfimas Posts: 1Member
I have played around with python for a while, and I thought I'd try the Tkiner window API. But something in my program causes python to hang and as far as I can tell, it's a call to Tk.quit that makes it hang.

I used this [link=http://www.pythonware.com/library/tkinter/introduction/hello-again.htm]guide as[/link] a template for my program

I use IDLE with python 2.7 on a MacBook 2.1 with Mac OS X 10.5.5 as my programming environment.

Here's the source code:
[code]
from Tkinter import *

class App:
def __init__(self, master):
frame = Frame(master)
frame.pack()

self.txt = Entry(frame)
self.txt.pack(side=TOP)

self.button = Button(frame, text="Print", command=frame.quit)
self.button.pack(side=BOTTOM)


def say_hi(self):
print str(self.txt.get())

root = Tk()

app = App(root)

root.mainloop()
[/code]

Please, if anyone knows why my program hangs, reply.

[edit] I think it's IDLE that's causing the problem. When I run the program in the terminal it does not hang. [/edit]
Sign In or Register to comment.