Tkinter(2)

Zentrader zentraders at gmail.com
Tue Sep 4 17:38:08 CEST 2007


On Sep 4, 6:42 am, vijayca <vijay... at gmail.com> wrote:
> my python installation is:Active python 2.5.1
> i am using Red Hat Linux
> i have the Tkinter module installed but any simple script produces an
> error....
>
> script:
> from Tkinter import Label
> widget = Label(None, text='Hello GUI world!')
> widget.pack()
> widget.mainloop()
>
> error:
> Traceback (most recent call last):
>   File "guy.py", line 2, in <module>
>     widget = Label(None, text='Hello GUI world!')
>   File "/root/Desktop/pythonall/ActivePython-2.5.1.1-linux-x86/
> INSTALLDIR/lib/python2.5/lib-tk/Tkinter.py", line 2464, in __init__
>     Widget.__init__(self, master, 'label', cnf, kw)
>   File "/root/Desktop/pythonall/ActivePython-2.5.1.1-linux-x86/
> INSTALLDIR/lib/python2.5/lib-tk/Tkinter.py", line 1923, in __init__
>     BaseWidget._setup(self, master, cnf)
>   File "/root/Desktop/pythonall/ActivePython-2.5.1.1-linux-x86/
> INSTALLDIR/lib/python2.5/lib-tk/Tkinter.py", line 1898, in _setup
>     _default_root = Tk()
>   File "/root/Desktop/pythonall/ActivePython-2.5.1.1-linux-x86/
> INSTALLDIR/lib/python2.5/lib-tk/Tkinter.py", line 1636, in __init__
>     self.tk = _tkinter.create(screenName, baseName, className,
> interactive, wantobjects, useTk, sync, use)
> _tkinter.TclError: no display name and no $DISPLAY environment
> variable
>
> please help me....
> i hate those error messages...
> vijay

See this example
http://www.pythonware.com/library/tkinter/introduction/hello-tkinter.htm#AEN50
http://www.python-eggs.org/?row=2




More information about the Python-list mailing list