Tkinter code (with pmw) executing to soon please help
Eric_Dexter at msn.com
Eric_Dexter at msn.com
Sun Jan 14 02:36:51 EST 2007
C:\dex_tracker\csdlist.py bay-at-night.csd
Traceback (most recent call last):
File "C:\dex_tracker\csdlist.py", line 58, in
root.mainloop()
File "C:\Python25\lib\lib-tk\Tkinter.py", line 1023, in mainloop
self.tk.mainloop(n)
File "../../..\Pmw\Pmw_1_2\lib\PmwBase.py", line 1751, in __call__
File "../../..\Pmw\Pmw_1_2\lib\PmwBase.py", line 1777, in _reporterror
TypeError: unsupported operand type(s) for +: 'type' and 'str'
Script terminated.
It doesn't like the return handler part of it.
Scott David Daniels wrote:
> Gabriel Genellina wrote:
> >... So `callback` should return a function, like this:
> >
> > def callback(text):
> > def handler(event):
> > print text
> >
>
> Even better than that:
> def callback(text):
> def handler(event):
> print text
> return handler
>
> Otherwise callback returns the spectacularly un-useful value None.
>
> --Scott David Daniels
> scott.daniels at acm.org
More information about the Python-list
mailing list