473,785 Members | 2,969 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unknown Tkinter bug

Hi all

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

---BEGIN
win=Tkinter.Tk( )
can=Tkinter.Can vas(win,width=5 00,height=500,b ackground='blue ')
can.pack()

# creating main lines
can.create_rect angle(10,10,490 ,490)
can.create_line (25,225,485,225 )
can.create_line (250,470,250,20 )
can.create_poly gon((245,20),(2 50,10),(255,20) )
can.create_poly gon((475,230),( 485,225),(475,2 20))
can.create_text (460,250,text=' dV [m3]')
can.create_text (280,25,text='d U [J]')

# creating sublines
while x<450 or y<450 :
can.create_line ((30+x,220),(30 +x,225),(30+x,2 30))
can.create_line ((245,25+y),(25 0,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,outl ine='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,te xt=int(maxdeV), fill='white')
can.create_text (250+10,250-200,text=int(ma xdeU),fill='whi te',anchor='w')
can.create_text (250-200,240,text=in t(mindeV),fill= 'white')
can.create_text (250-30,250+200,text =int(mindeU),fi ll='white',anch or='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\Sc riptBinding.py" ,
line 157, in run_module_even t
interp.runcode( code)
File "C:\Program Files\Python232 \lib\idlelib\Py Shell.py",
line 658, in runcode
self.interp.res tart_subprocess ()
AttributeError: ModifiedInterpr eter instance has no attribute 'interp'
---END

Where should i look for a mistake?

--
Krzysztof Szynter :'''. :. : *
Dygi GG 1027078 :...' ..... : : : ..... . . . . . .....
http://newbie.friko.pl : : :.... : : : :.... :: :: :.. : :....
dygimail(at)poc zta(dot)fm :...' :.... : ': :.... : : :..' : :....
Jul 18 '05 #1
2 1563
Krzysztof Szynter <dy********@SPA Mpoczta.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\Sc riptBinding.py" ,
line 157, in run_module_even t
interp.runcode( code)
File "C:\Program Files\Python232 \lib\idlelib\Py Shell.py",
line 658, in runcode
self.interp.res tart_subprocess ()
AttributeError: ModifiedInterpr eter 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
kl*******@web.d e (klappnase) wrote in
news:a7******** *************** ***@posting.goo gle.com:
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)poc zta(dot)fm :...' :.... : ': :.... : : :..' : :....
Jul 18 '05 #3

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

Similar topics

1
5986
by: Josh | last post by:
Caution, newbie approaching... I'm trying to come up with a very simple Tkinter test application that consists of a window with a drop-down menu bar at the top and a grid of colored rectangles filling the remainder of the window. Mind you, this is a contrived test application to help me understand Tkinter and Python, not an actual application yet. I've trivially subclassed Tkinter.Canvas into ColorCanvas, added a bunch of ColorCanvases...
3
7036
by: srijit | last post by:
Hello, Any idea - why the following code crashes on my Win 98 machine with Python 2.3? Everytime I run this code, I have to reboot my machine. I also have Win32all-157 installed. from Tkinter import * class App:
1
2977
by: syed_saqib_ali | last post by:
Please take a look at and run the code snippet shown below. It creates a canvas with vertical & Horizontal scroll-bars. If you shrink the window to smaller than the area of the canvas, the scroll-bars work as advertised. That's great. However, if you click the Left Mouse button, it calls code which expands the width of the canvas by 100 pixels. The area being viewed expands correspondingly..... BUT I DON'T WANT IT TO!!
0
3587
by: syed_saqib_ali | last post by:
Below is a simple code snippet showing a Tkinter Window bearing a canvas and 2 connected scrollbars (Vertical & Horizontal). Works fine. When you shrink/resize the window the scrollbars adjust accordingly. However, what I really want to happen is that the area of the canvas that the scrollbars show (the Scrollregion) should expand as the window grows. It doesn't currently do this. although, if the window shrinks smaller than the...
1
3600
by: Michael Yanowitz | last post by:
Hello: Below I have included a stripped down version of the GUI I am working on. It contains 2 dialog boxes - one main and one settings. It has the following problems, probably all related, that I am hoping someone knows what I am doing wrong: 1) Pressing the Settings.. Button multiple times, brings up many instances of the Settings Panel. I just want it to bring up one. Is there an easy way to do that?
3
3611
by: dwelch91 | last post by:
I'm trying unsuccessfully to do something in Tk that I though would be easy. After Googling this all day, I think I need some help. I am admittedly very novice with Tk (I started with it yesterday), so I am sure I am overlooking something simple. The basic idea is that my application will consist of a series of modal dialogs, that are chained together in "wizard" fashion. There will be some processing in between dialogs, but for the most...
1
5256
by: yvesd | last post by:
hello i want to intercept tkinter python system events like wm_delete_window and if possible for any window, but the newest code I've produced give me an error : Traceback (most recent call last): File "C:\Documents and Settings\yvesd\Bureau\protowin.py", line 36, in ? b1 = Tkinter.Button (win1)
8
3288
by: karthikbalaguru | last post by:
Hi, One of my python program needs tkinter to be installed to run successfully. I am using Redhat 9.0 and hence tried installing by copying the tkinter-2.2.2-36.i386.rpm alone from the CD 3 to my pc. But, it is not getting installed and is failing by throwing the below errors. Should i need to configure / install any specific files for resolving this issue ?
3
2983
by: joshdw4 | last post by:
I hate to do this, but I've thoroughly exhausted google search. Yes, it's that pesky root window and I have tried withdraw to no avail. I'm assuming this is because of the methods I'm using. I guess my question is two-fold. 1) How do I get rid of that window? 2) Any comments in general? I am just learning python (and coding with classes), so I'm sure there are things I should pound into my head before I learn bad habits. Here's the...
0
10325
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10091
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8972
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.