Occidentalis v0.2, WebIDE, and Tkinter

Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Locked
User avatar
ptdecker
 
Posts: 16
Joined: Fri Dec 17, 2010 2:33 pm

Occidentalis v0.2, WebIDE, and Tkinter

Post by ptdecker »

Hello!

I have installed the WebIDE on Occidentalis v0.2 on my Raspberry Pi. Everything seems to be working fine (nice tutorials!).

However, I'm trying to run the simple program below using the Tkinter GUI libraries:

Code: Select all

# File: hello1.py

from Tkinter import *

# Create root window

root = Tk()
root.title("My First Raspberry Pi GUI")
root.geometry("200x85")

# Create a frame

app = Frame(root)
app.grid()

# Create a button in the frame

bttn1 = Button(app, text = "Click me!")
bttn1.grid()

# Start main loop

root.mainloop()
And, I receive the following error when I run it:

Code: Select all

webide@raspberrypi /usr/share/adafruit/webide/repositories/my-pi-projects/Hello_World $ sudo python hello1.py                                                                                                                          
Traceback (most recent call last):                                                                                                                                                                                                     
  File "hello1.py", line 7, in <module>                                                                                                                                                                                                
    root = Tk()                                                                                                                                                                                                                        
  File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1688, in __init__                                                                                                                                                                  
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)                                                                                                                             
_tkinter.TclError: no display name and no $DISPLAY environment variable 
I have tried to manually set the $DISPLAY environment variable to the LXDE session running off the HDMI port on the Raspberry PI itself whose $DISPLAY environment variable I confirmed is ':0.0' but had no luck.

Any ideas? Is Occidentalis and the WebIDE incompatible with Tkinter?

P. Todd

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Occidentalis v0.2, WebIDE, and Tkinter

Post by adafruit »

the WebIDE is not intended for use with anything except for 'command line' python & our tutorials, so anything else is not supported and should be assumed to not work. we dont have any plans to make tkinter work - our priority is better command-line python support at this time, only

Locked
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Return to “Adafruit Raspberry Pi® accessories”