Difference between revisions of "Python"

From Chumby Wiki
Jump to: navigation, search
 
(21 intermediate revisions by 6 users not shown)
Line 1: Line 1:
'''why Python?'''
+
==Why Python?==
* because writing is C sucks
+
* because writing in C sucks
 
* your time is valuable
 
* your time is valuable
 
* once a python zealot, always a python zealot.
 
* once a python zealot, always a python zealot.
  
 +
==Compiling python from source==
  
''' Compiling python from source '''
+
# Construct the [[Scratchbox]] environment.
 +
# Download the source to the python flavor of your choice
 +
# {{Command|./configure; make; make install}}
  
Supposedly there are patches that will allow you cross compile python.  Unfortunately I wasn't able to get it to work.  The problem is that the Python build system uses the binary it generates to finish the build process - meaning that in a cross compiling situation you have to build an arm binary *and* a localhost binary (i686-linux-gnu or whatever).<br/>
+
==If you're too lazy to do all that...==
<br/>
+
You can download all of this prebuilt in [http://files.chumby.com/languages/python/python2.6-chumby.tgz python2.6-chumby.tgz] (13MB).
A good starting point is http://www.mail-archive.com/patches@python.org/msg03662.html.
+
  
''' using an existing python binary '''
+
Just unpack onto a USB drive, add your python code and a "debugchumby" script, and you can write your own python applications for your chumby!
 
+
<p>
+
Luckily a number of existing linux platforms already support builds for the arm-linux.  It is fairly painless to grab a binary from one of these systems and make it work on the chumby.  I used the binary from [http://pymaemo.sourceforge.net/cgi-bin/moin.cgi python for maemo] project.  The [http://maemo.org/ Maemo] project is the open source effort by Nokia to get linux and associated tools work on their arm based 770 platform.
+
</p>
+

Latest revision as of 14:10, 27 November 2010

Why Python?

  • because writing in C sucks
  • your time is valuable
  • once a python zealot, always a python zealot.

Compiling python from source

  1. Construct the Scratchbox environment.
  2. Download the source to the python flavor of your choice
  3. ./configure; make; make install

If you're too lazy to do all that...

You can download all of this prebuilt in python2.6-chumby.tgz (13MB).

Just unpack onto a USB drive, add your python code and a "debugchumby" script, and you can write your own python applications for your chumby!