Running python on android

Add a comment

hi!

I’m back – now it’s time to get some nice programs running on your android phone.

I found the python binary on the following website:  www.damonkohler.com

and here’s the binary: python2.4 binary

as you can read, there are still problems running lots of the libraries, but I think that I found a solution:

download the the standard python libraries here: python_lib
first mount the sdcard (home screen) and copy all the files to your /sdcard (also the python binary)

then umount the sdcard (home screen) and open a terminal to connect to your phone through adb (adb shell)

type in the following commands:

su
mount -o remount,rw /dev/block/mtdblock3 /system
cp -R /sdcard/python2.4 /system/bin/python
chmod 777 /system/bin/python
export PYTHONHOME=”/sdcard/lib/python2.4/”
export PYTHONPATH=”/sdcard/lib/python2.4/”
mount -o remount,rw /dev/block/mtdblock3 /system
python

screenshot_android

and you are done :D

##UPDATE:

If you want to permanently add the global vars just edit your init.rc and add the following vars under “# setup the global environment”

export PYTHONHOME=”/sdcard/lib/python2.4/”
export PYTHONPATH=”/sdcard/lib/python2.4/”

PS: don’t forget to remount the rootfs before editing the init.rc (mount -o remount,rw rootfs /)

This entry is filed under android, g1, software. You can follow any responses to this entry through RSS 2.0. You can leave a response, or trackback from your own site.

  1. No Comments
Post your comment