By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,985 Members | 1,574 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,985 IT Pros & Developers. It's quick & easy.

Unknown Tkinter bug

P: n/a
Hi all

Like i said, i'am back. With another problem of course.
This is my code:

---BEGIN
win=Tkinter.Tk()
can=Tkinter.Canvas(win,width=500,height=500,backgr ound='blue')
can.pack()

# creating main lines
can.create_rectangle(10,10,490,490)
can.create_line(25,225,485,225)
can.create_line(250,470,250,20)
can.create_polygon((245,20),(250,10),(255,20))
can.create_polygon((475,230),(485,225),(475,220))
can.create_text(460,250,text='dV [m3]')
can.create_text(280,25,text='dU [J]')

# creating sublines
while x<450 or y<450 :
can.create_line((30+x,220),(30+x,225),(30+x,230))
can.create_line((245,25+y),(250,25+y),(255,25+y))
x=x+10
y=y+10

# starting drawing function image
for i in range(0,len(deV)):
can.create_oval(250+deV[i],250-deU[i],250+deV[i]+1,
250-deU[i]+1,width=3,outline='white')
for i in range(0,len(deV)-1):
can.create_line(250+deV[i],250-deU[i],250+deV[i+1],
250-deU[i+1],width=1,fill='yellow')

# creating etiquettes
can.create_text(250+200,210,text=int(maxdeV),fill= 'white')
can.create_text(250+10,250-200,text=int(maxdeU),fill='white',anchor='w')
can.create_text(250-200,240,text=int(mindeV),fill='white')
can.create_text(250-30,250+200,text=int(mindeU),fill='white',anchor='s ')

win.mainloop()
---END

After i close graphcial window, shell gives this error message:

---BEGIN
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Program Files\Python232\lib\lib-tk\Tkinter.py",
line 1345, in __call__
return self.func(*args)
File "C:\Program Files\Python232\lib\idlelib\ScriptBinding.py",
line 157, in run_module_event
interp.runcode(code)
File "C:\Program Files\Python232\lib\idlelib\PyShell.py",
line 658, in runcode
self.interp.restart_subprocess()
AttributeError: ModifiedInterpreter instance has no attribute 'interp'
---END

Where should i look for a mistake?

--
Krzysztof Szynter :'''. :. : *
Dygi GG 1027078 :...' ..... : : : ..... . . . . . .....
http://newbie.friko.pl : : :.... : : : :.... :: :: :.. : :....
dygimail(at)poczta(dot)fm :...' :.... : ': :.... : : :..' : :....
Jul 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Krzysztof Szynter <dy********@SPAMpoczta.fm> wrote in message news:<Xn******************************@127.0.0.1>. ..

<snip>

After i close graphcial window, shell gives this error message:

---BEGIN
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Program Files\Python232\lib\lib-tk\Tkinter.py",
line 1345, in __call__
return self.func(*args)
File "C:\Program Files\Python232\lib\idlelib\ScriptBinding.py",
line 157, in run_module_event
interp.runcode(code)
File "C:\Program Files\Python232\lib\idlelib\PyShell.py",
line 658, in runcode
self.interp.restart_subprocess()
AttributeError: ModifiedInterpreter instance has no attribute 'interp'
---END

Where should i look for a mistake?


Here's what I get when I run your example:

Traceback (most recent call last):
File "/usr/local/share/test.py", line 19, in ?
while x<450 or y<450 :
NameError: name 'x' is not defined

you actually use a couple of other variables that are not defined,
too,
so I think this is maybe not the complete code ?
Maybe you should have a look at the rest of the code if you have
problems.

BTW, the traceback you posted seems to look like an IDLE problem
rather than a Tkinter bug I think (at least PyShell.py is the main
file that runs IDLE's
Shell window).

Regards

Michael
Jul 18 '05 #2

P: n/a
kl*******@web.de (klappnase) wrote in
news:a7**************************@posting.google.c om:
you actually use a couple of other variables that are not defined,
too, so I think this is maybe not the complete code ?
Yes.
Maybe you should have a look at the rest of the code if you have
problems.
This piece of code generates a bug.
BTW, the traceback you posted seems to look like an IDLE problem
rather than a Tkinter bug I think (at least PyShell.py is the main
file that runs IDLE's Shell window).


You were right. Restart the shell and the pc helped.

--
Krzysztof Szynter :'''. :. : *
Dygi GG 1027078 :...' ..... : : : ..... . . . . . .....
http://newbie.friko.pl : : :.... : : : :.... :: :: :.. : :....
dygimail(at)poczta(dot)fm :...' :.... : ': :.... : : :..' : :....
Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.