User:Rmyers/IDLE on the XO

From OLPC
< User:Rmyers
Revision as of 20:25, 20 July 2008 by Rmyers (talk | contribs) (working on Tkinter)
Jump to: navigation, search

IDLE is the default IDE for Python. The XO has a very limited Python viewer and editor Pippy. There is a more advanced environment Develop under development.

I decided to try to get the IDLE environment working on the XO. I wanted an XO based Python IDE that I could use to show Python code, and which would allow intermediate level development directly on the XO. As Develop matures this will probably no longer be necessary.

Warning:

I have successfully istalled IDLE on my XO. However this document is a work in progress and may contain errors. This message will be removed when I'm confident in this document's essential accuracy. Hopefully this will be by about 7/25/08.

What's already there

The Python 2.5 distribution that comes on the XO already contains IDLE. The IDLE library is located at /usr/lib/Python2.5/idlelib. The IDLE main module is idle.py.

So in a terminal window you ought to be able to

   cd /usr/lib/python2.5/idlelib
   python idle.py

to fire it up.

This doesn't quite work. You'll get a message that tkinter is missing.

Tkinter

Tk is a platform independent GUI framework.

Tkinter is the Python binding to it. By default this is not installed on the XO.

IDLE requires tkinter for some graphics services.

Tkinter can be intalled by doing the following:

   su
   yum install tkinter
   exit

Tkinter should now be installed at /usr/lib/python2.5/lib-tk.

There are some modules of this that can be run from python that will give you an idea what services are provided.

Font issues

IDLE under Sugar

IDLE under XFCE