wiki:pygame_touchpad

Version 23 (modified by Martin Kolman, 12 years ago) (diff)

--

PyGame on the HP Touchpad tablet

http://www.modrana.org/images/touchpad_pygame.jpg

This is a short guide on how to install Python and PyGame on the WebOS based HP Touchpad tablet. The Python and PyGame porting work and WebOS bindings were done by THP and are available from his WebOS page.

Manual installation

Prerequisites

Download the Python and PyGame binaries from THPs WebOS hacks website:
Python 2.7 runtime
PyGame build for WebOS
Python bindings for WebOS

Download some PyGame proggam that can be used to test if PyGame is actually working. Possible candidates:

The startup script

this is a short startup script that makes it possible to just unpack the binaries to a random folder and use Python & PyGame without the need to install anything to system wide directories.

#!/bin/sh

## A setup and demonstration script for PyGame
## on the HP Touchpad WebOS tablet

## get current folder path
CURRENT_FOLDER=${PWD}

## path to the Python runtime
## NOTE: content of the Python 2.7 runtime has been
## placed to the python2.7 folder
PY_PATH=${CURRENT_FOLDER}"/python27"
export PY_PATH

## path to the Pygame runtime/library
## NOTE: it is enough to add the folder
## that contains the Pygame folder to Python path
PYGAME_PATH=${CURRENT_FOLDER}

## add the Python runtime to the system path
PATH=${PY_PATH}/bin:$PATH
export PATH

## add the Python runtime to the system library path
LD_LIBRARY_PATH=${PY_PATH}/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH

## add Pygame to the Python path
PYTHONPATH=${PYGAME_PATH}:$PYTHONPATH
export PYTHONPATH

##
## the environment should now be ready for running
## Python applications using PyGame
##

## start the example application
## NOTE: the game folder has been renamed to a shorter name
echo "** starting example application **"

cd ttt
python main.py

Just dump this script to a file called for example start.sh (or download start.sh) and run it with:

sh start.sh

PyGame bundle

I have created a bundle that contains THP's Python & PyGame files, the Thrifty Threesome Thriller game to test functionality and my startup script.

Just download the bundle:
pygame_bundle.zip (23 MB)

Place it to some directory, unzip it and run the start.sh script:

unzip pygame_bundle.zip
cd pygame_test
sh start.sh