Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

Tkinter hangs on mainloop

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


mrfusion at bigfoot

Apr 19, 1999, 11:19 PM

Post #1 of 4 (230 views)
Permalink
Tkinter hangs on mainloop

Hi,
I've done a complete install of python ver 1.5.2 on my
windows98 system and I've run into a problem with Tkinter (no big
surprise!) I can import it with the line : from Tkinter import *
Everything seems to be fine so far. I add a few more lines:

widget = Lable(None, text = 'Hello')
widget.pack()

Everything great so far.....

widget.mainloop()

It hangs. If I wait for a while and then hit Ctr-C I get the
following error:

Traceback (innermost last):
File "<stdin>", line 1, in ?
File "k:\python\lib\lib-tk\Tkinter.py", line 492, in mainloop
self.tk.mainloop(n)
KeyboardInterrupt


This happens whenever I try to run a program that uses Tkinter.
For some reason I can get the tkFileDialog.py and the
tkColorChooser.py to run alright but nothing else......very weird.

Can anyone offer insight to this baffling problem??

Thank you so much,

Tom


fredrik at pythonware

Apr 20, 1999, 2:34 AM

Post #2 of 4 (236 views)
Permalink
Tkinter hangs on mainloop [In reply to]

<mrfusion [at] bigfoot> wrote:
> I've done a complete install of python ver 1.5.2 on my
> windows98 system and I've run into a problem with Tkinter (no big
> surprise!) I can import it with the line : from Tkinter import *

I assume you're running this from the command
line, right?

> widget.mainloop()
>
> It hangs.

not really. it doesn't hang, it just doesn't return
immediately. in fact, it won't return until you've
closed the root window.

> If I wait for a while and then hit Ctr-C I get the
> following error:
>
> Traceback (innermost last):
> File "<stdin>", line 1, in ?
> File "k:\python\lib\lib-tk\Tkinter.py", line 492, in mainloop
> self.tk.mainloop(n)
> KeyboardInterrupt

before you to this, look in the task bar. click on
the Tk icon, and the (quite small) window will pop
up.

http://www.pythonware.com/library/tkinter/introduction/intro01.htm
has some more information on the mainloop function.

</F>


mrfusion at bigfoot

Apr 20, 1999, 7:49 PM

Post #3 of 4 (227 views)
Permalink
Tkinter hangs on mainloop [In reply to]

>> I've done a complete install of python ver 1.5.2 on my
>> windows98 system and I've run into a problem with Tkinter (no big
>> surprise!) I can import it with the line : from Tkinter import *
>
>I assume you're running this from the command
>line, right?

I've tried both from the command line and double clicking the file
name (I have the proper associations set up). I've tried running
k:\python\python tktest.py, I've tried starting python and typing the
file in one line at a time, I've even tried waving a dead chicken over
my computer. No luck.


>> It hangs.
>
>not really. it doesn't hang, it just doesn't return
>immediately. in fact, it won't return until you've
>closed the root window.

Actaully it doesn't return at all.....ever.
If I close the root window, I get a messsage from windows that says :
"Windows can't shut this program down automatically. It is recommended
that you close the program....bla bla bla".


>before you to this, look in the task bar. click on
>the Tk icon, and the (quite small) window will pop
>up.

I've looked, there's no icon on the task bar. I've check through the
task manager and there's nothing there either.


>
>http://www.pythonware.com/library/tkinter/introduction/intro01.htm
>has some more information on the mainloop function.


I went to this site and typed in the example file (it was basically
the same one that I was trying to run). I still get nothing.


Any other suggestions?

Thank you for trying to help ,

Tom


mrfusion at bigfoot

Apr 20, 1999, 9:05 PM

Post #4 of 4 (227 views)
Permalink
Tkinter hangs on mainloop [In reply to]

On Wed, 21 Apr 1999 02:49:43 GMT, mrfusion [at] bigfoot wrote:


>>> It hangs.


I think I've narrowed it down the the tcl\tk installation. The wish80
program doesn't seem to work correctly. If I double click on the
program, nothing happens. I downloaded an earlier version of tcl\tk,
installed it and that version of wish worked just fine. I've also
noticed that when I try to start my "hello world" python\TK scipt,
while it's hanging there it seems to keep spawning wish80 processes.
If I kill them in the task switcher, another one (or two or three)
keeps showing up.

I've tried downloading the latest install (8.0.5) files directly from
http://www.scriptics.com but that didn't seem to fix anything.

Does this shed any light on the problem???


Thanks,
Tom

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.