Python modules not updating after restarting the main module.

Posted by Ian on Stack Overflow See other posts from Stack Overflow or by Ian
Published on 2010-05-04T04:54:00Z Indexed on 2010/05/04 4:58 UTC
Read the original article Hit count: 264

Filed under:
|
|
|

I've recently come back to a project having had to stop for about 6 months, and after reinstalling my operating system and coming back to it I'm having all kinds of crazy things happen. I made sure to install the same version(2.6) of python that I was using before.

It started by giving me strange tkinter error that I hadn't had trouble with before, the program is relatively simple and the 2 or 3 bugs that were left when i quit, I had documented and weren't related to the interface.

Things got even weirder when the same error would pop up even after I had removed the offending section of code. In fact, the traceback pointed to a line that didn't even exist in the module it was referencing, eg: line 262 when the module was only 200 lines long.

After just starting a completely new file for the main module and copy/pasting it finally recognized that the offending code was gone and I stopped getting the error only to find that any updates to the code I made in another module didn't show up when I restarted the program through the shell. (I didn't forget to save.) After fiddling with this, of course, the old interface error came back, only in a different section of code that had been working previously.

In fact, if I revert back to the files I had six months ago, the program works fine. As soon as I change anything in the main module, however, the interface bug comes back.

Here's the original error:

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Python26\lib\lib-tk\Tkinter.py", line 1410, in __call__
return self.func(*args)
  File "C:\PyStuff\interface.py", line 202, in dispOne
__main__.top.destroy()
  File "C:\Python26\lib\lib-tk\Tkinter.py", line 1938, in destroy
    self.tk.call('destroy', self._w)
TclError: can't invoke "destroy" command:  application has been destroyed

I'm guessing something else is going on here other than my own poor programming. Anyone have any ideas?

© Stack Overflow or respective owner

Related posts about python

Related posts about tkinter