Occidentalis v0.2, WebIDE, and Tkinter

Talk about Adafruit Raspberry Pi® accessories!

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/

Occidentalis v0.2, WebIDE, and Tkinter

Postby ptdecker » Sat Jan 26, 2013 6:28 pm

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
ptdecker
 
Posts: 2
Joined: Fri Dec 17, 2010 1:33 pm

Re: Occidentalis v0.2, WebIDE, and Tkinter

Postby adafruit » Sun Jan 27, 2013 9:41 pm

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
User avatar
adafruit
 
Posts: 10485
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc


Return to Adafruit Raspberry Pi® accessories

Who is online

Users browsing this forum: No registered users and 2 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [100]

Raspberry Pi[80]
 
FLORA[23]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[11]
Arduino[60]
 
NETduino[14]
 
BeagleBone[24]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[33]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[8]


 
Breakout Boards[33]
LCDs & Displays[48]
Components & Parts[69]
Batteries & Power[49]
EL Wire/Tape/Panel[52]
LEDs[108]
 
Wireless[14]
Cables[60]
 
Lasers[6]
Sensors/Parts[145]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[69]
 
iDevices[13]
Tools[71]
 
Wearables[39]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[24]


 
Stickers[41]
 
Skill badges[55]
 
Books[25]
 
Circuit Playground[7]
 
Gift Certificates[4]