467,925 Members | 2,023 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,925 developers. It's quick & easy.

TKinter and Python Sync. Problems

I am currently having trouble running a piece of code I have written. My
main code is called new.py, and when I run it, it pops up the TKinter root
window as specified. However, if I try perform a function that uses an
imported module, the code crashes, giving me this error:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python24\lib\lib-tk\Tkinter.py", line 1345, in __call__
return self.func(*args)
File "C:\jython\new.py", line 38, in save_var
var = expression.Variable(name, description)
AttributeError: 'module' object has no attribute 'Variable'

Now, when I close the TKinter window that popped up when the code was
compiled, an identical one is opened in its place. If I perform the same
action as before, the program works flawlessly. Also worth noting is that
when this same file is run from SPE, this problem does not ocur.

Does anyone have any idea why this would happen? I do not understand why a
new Window is created when I try to close it if run from the command line.
Also, I don't understand why it can't find the proper module the on the
first run, but can on the second. It seems weird that it doesn't also
happen from the IDE.

Another interesting thing to note is that if I run the module that it chokes
on intially, ie. 'python expr.py', it brings up the GUI associated with the
main code. The problem is, there is no TKinter related code in the expr
module!

If any additional info or clarification would be helpful, please let me
know. Thanks in advance for the help, as I am truly perplexed as to what is
going on!!
Jul 19 '05 #1
  • viewed: 957
Share:

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by srijit | last post: by
7 posts views Thread by John Slimick | last post: by
7 posts views Thread by SeeBelow | last post: by
1 post views Thread by Michael Yanowitz | last post: by
1 post views Thread by vijayca | last post: by
reply views Thread by wolfonenet | last post: by
3 posts views Thread by J-Burns | last post: by
reply views Thread by Steve Holden | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.