473,396 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Tkinter callback caused abnormal program termination

Running my programme in Python 2.3.4 I received the following msg in the
consol :-
(Pent III running W2K prof)

"""
Exception in Tkinter callback
Traceback (most recent call last):
File "c:\apps\python\234\lib\lib-tk\Tkinter.py", line 1345, in __call__
return self.func(*args)
File "c:\apps\python\234\lib\lib-tk\Tkinter.py", line 459, in callit
self.deletecommand(tmp[0])
AttributeError: 'str' object has no attribute 'deletecommand'
UpdateStringProc should not be invoked for type option

abnormal program termination
"""
There was no other traceback information.

Could this be related to lines of the ilk:-
self.infoSpd.config(text="%d.%01d"%spd)
where infoSpd is a Tkinter Label object placed using the grid manager.

Thousands of these updates were performed so the labels displayed progress
through a memory dump of a system accessed through a serial port.

I had trouble before with Python versions 2.2.1 and 2.2.3 where commenting
out these Label updates stopped the system crashing and it was happy to run
for hours performing tests on the external hardware. (an embedded data
logger I'm developing)

Anyone any thoughts?

John
Jul 18 '05 #1
2 3388
On Tue, 09 Nov 2004 17:41:56 GMT, John Pote <jo******@blueyonder.co.uk>
wrote:
Running my programme in Python 2.3.4 I received the following msg in the
consol :-
(Pent III running W2K prof)

"""
Exception in Tkinter callback
Traceback (most recent call last):
File "c:\apps\python\234\lib\lib-tk\Tkinter.py", line 1345, in __call__
return self.func(*args)
File "c:\apps\python\234\lib\lib-tk\Tkinter.py", line 459, in callit
self.deletecommand(tmp[0])
AttributeError: 'str' object has no attribute 'deletecommand'
UpdateStringProc should not be invoked for type option

abnormal program termination
"""
There was no other traceback information.

Could this be related to lines of the ilk:-
self.infoSpd.config(text="%d.%01d"%spd)
where infoSpd is a Tkinter Label object placed using the grid manager.

Thousands of these updates were performed so the labels displayed
progress
through a memory dump of a system accessed through a serial port.

I had trouble before with Python versions 2.2.1 and 2.2.3 where
commenting
out these Label updates stopped the system crashing and it was happy to
run
for hours performing tests on the external hardware. (an embedded data
logger I'm developing)

Anyone any thoughts?

John

Only one (thought that is) Are you updating thses Label widgets from other
threads? and could you possibly post an example?

Martin

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

Jul 18 '05 #2

"Martin Franklin" <mf********@gatwick.westerngeco.slb.com> wrote in message
news:ma**************************************@pyth on.org...
On Tue, 09 Nov 2004 17:41:56 GMT, John Pote <jo******@blueyonder.co.uk>
wrote:
Running my programme in Python 2.3.4 I received the following msg in the
consol :-
(Pent III running W2K prof)

"""
Exception in Tkinter callback
Traceback (most recent call last):
File "c:\apps\python\234\lib\lib-tk\Tkinter.py", line 1345, in __call__
return self.func(*args)
File "c:\apps\python\234\lib\lib-tk\Tkinter.py", line 459, in callit
self.deletecommand(tmp[0])
AttributeError: 'str' object has no attribute 'deletecommand'
UpdateStringProc should not be invoked for type option

abnormal program termination
"""
There was no other traceback information.

Could this be related to lines of the ilk:-
self.infoSpd.config(text="%d.%01d"%spd)
where infoSpd is a Tkinter Label object placed using the grid manager.

Thousands of these updates were performed so the labels displayed
progress
through a memory dump of a system accessed through a serial port.

I had trouble before with Python versions 2.2.1 and 2.2.3 where
commenting
out these Label updates stopped the system crashing and it was happy to
run
for hours performing tests on the external hardware. (an embedded data
logger I'm developing)

Anyone any thoughts?

John

Only one (thought that is) Are you updating thses Label widgets from
other
threads? and could you possibly post an example?

Martin

Ahhhh -- Experience had already taught me that lesson about tkinter. On
checking my code guess what I found I'd done - called the widget.config
method from the other thread. So I put in a list to queue the label updates
from the other thread to the tkinter thread and it's now been running for
several hours without problem.

Thanks for the reminder.

BTW the program structure I've been using is:-

def otherThread():
while TRUE:
if updatelabel:
labelQ = "new label text"

def guiLoop():
if labelQ:
myLabel.config(text=labelQ)
labelQ = None
#re-register this fn to run again
rootWin.after(10, guiLoop) #strangely .after_idle(guiLoop) is slower!
..
..
rootWin = Tk(className=" tester")

#rest of GUI set up. then:-

thread.start_new( otherThread, () )
rootWin.after(50, guiLoop)
rootWin.mainloop()

It works but is it the best way to do this sort of thing? The point is that
I need moderately fast serial comms, which I do in 'otherThread' and found
the 'after' and 'after_idle' call backs were too slow. The timing I did on
py2.2.1 indicated that 'after_idle' could not do better than ~70ms and
'after(10, ....)' was faster, 30-40 ms, but still too slow for my app.

Any more thoughts appreciated.

John
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Markus von Ehr | last post by:
Hi, I tried to build the swig: callback example, but when I run the runme.py file I get a message box: abnormal program termination The error appears in already in the first line of the...
2
by: Russell E. Owen | last post by:
I want to support execution of simple user-written scripts in a Tkinter application. The scripts should be able to wait for data and such without hanging the GUI (and without having to write the...
2
by: Elbert Lev | last post by:
#When I'm running this script on my windows NT4.0 box, #every time dialog box is reopened there is memory growth 384K. #Bellow is the text I sent to Stephen Ferg (author of easygui) # I have...
1
by: R6_2003 | last post by:
Hello all, i dunno if that's the right newsgroup to ask, but i'll try, please ignore me if u feel its not 0:) i've been messing with a control panel app for so long.. previously i was using...
3
by: Mahmood Ahmad | last post by:
Hello, I have written a program that reads three types of records, validates them acording to certain requirements and writes the valid records into a binary file. The invalid records are...
2
by: Hugh | last post by:
Hello, Apologies if this has already been answered in here and I can't find it, but can anyone help with this problem? I hope the example code and comments state clearly enough what is...
16
by: PyDenis | last post by:
Today, I found strange error while using py2exe: 1. I wrote simple program and save as 1.py: import win32ui import win32con win32ui.MessageBox('Test messageBox.' , 'Test', win32con.MB_OK |...
9
by: ehabaziz2001 | last post by:
I am facing that error message with no idea WHY the reason ? "Abnormal program termination" E:\programs\c_lang\iti01\tc201\ch06\ownarr01o01 Enter a number : 25 More numbers (y/n)? y...
2
by: Doran, Harold | last post by:
I am currently reading An Intro to Tkinter (1999) by F. Lundh. This doc was published in 1999 and I wonder if there is a more recent version. I've googled a bit and this version is the one I keep...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.