[Tkinter-discuss] Problem trying to use Tkinter in non-gui script

Parimala Ramdas Parimala.Ramdas at Zoran.com
Thu Jul 8 19:15:19 CEST 2004

Hello all!
  I have a piece of gui code using Tkinter that I put in a file
viewcvs.py of ViewCVS software. What I'm trying to do is, display a
dialog box when user clicks on a link "Download" The purpose is to ask
for a username before allowing user to download files. As soon as
username is entered in dialog box, it will verify the name. The code
works stand-alone but gives me error in viewcvs.py file. Anyone has any
idea why? Thanks in advance.
import Tkinter
root = Tkinter.Tk()

Python Exception Occured

Traceback (innermost last):
  File "/usr/local/viewcvs-0.9.2/lib/viewcvs.py", line 2741, in run_cgi
  File "/usr/local/viewcvs-0.9.2/lib/viewcvs.py", line 2722, in main
  File "/usr/local/viewcvs-0.9.2/lib/viewcvs.py", line 2624, in
    root = Tkinter.Tk()
  File "/usr/lib/python1.5/site-packages/lib-tk/Tkinter.py", line 886,
in __init__
    self.tk = _tkinter.create(screenName, baseName, className)
TclError: no display name and no $DISPLAY environment variable
Even if I copy lib-tk in site-packages dir, it gives me the same error.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20040708/9be97d5f/attachment.htm

More information about the Tkinter-discuss mailing list