Python

From OLPC
Revision as of 12:39, 7 February 2008 by Tehhax (talk | contribs) (Introduction)
Jump to: navigation, search
  english | español | português HowTo [ID# 106319]  +/-  

Lal

Obtaining and learning Python

Python is commonly provided by default on Linux and BSD systems. OLPC is currently using version 2.5 on the XO.

You can download nicely packaged Python called ActivePython. They proclaim themselves as the All-in-one Python distribution for AIX, HP-UX, Linux, Mac OS X, Solaris, and Windows.

PyGTK is the Python interface to the GTK GUI library used in the OLPC. This library is notable for a component named Pango which simplifies the use of multiple scripts and languages. In addition, it's basic drawing library, Cairo, has some of the best support of SVG rendering which is also a major component of the OLPC.

The Livewires Python Course may be useful to create some curriculum material to teach the kids how to write their own Python applications. It would need some adaptation to fit the OLPC environment.

The author of Python wrote a long tutorial.

Development Advice

Some things to consider in Python development:

  • PEP 8 is the Python style guide. On many issues the style guide suggests but does not require a particular style. Generally you should stick to the style guide, unless there is good reason not to. For instance, if you are interacting with a library (internal or external) that uses a different convention, don't try to translate the convention.