[Tutor] Segmentation Fault Problem

Anschau Gesicht anschau at shaw.ca
Fri Jan 2 21:04:32 EST 2004


On Fri, 02 Jan 2004 13:41:49 -0600
Anschau Gesicht <anschau at shaw.ca> wrote:

> I continue on my endless(and seemingly futile)attempt to learn a
> programming language.  Currently I'm attempting small scripts in
> Python/Tkinter.  The particular script is a textbox script at follows
> 
> #!/usr/bin/python2.3
> 
> from Tkinter import *
> from ScrolledText import *
> import sys
> 
> def die(event):
>   sys.exit(0)
> 
> root = Tk()
> f = Frame(root)
> f.pack(expand=1, fill=BOTH)
> button = Button(f, width=25)
> button["text"] = "Button"
> button.bind("<Button>",die)
> button.pack()
> 
> st = ScrolledText(f,background="white")
> st.pack()
> 
> root.mainloop()
> 
> Very simple and straight forward but if I mouseclick in the text
> window the program seg faults.  Can anyone tell me why?  As an aside,
> I cannot use idle (a text editor) because it seg faults everytime I
> try to initialize.  

I have solved my problem and I think it may have been mismatched
versions of python and tkinter.  Because I had a fairly recent install
of Redhat 9 I thought I had the original installs of both python and
tkinter.  It looks as though I may have upgraded python but not tkinter.
I've installed 2.3 version of each now and my script works as does idle.

Thanks everyone for pointing me in the right direction.

Eve



More information about the Tutor mailing list