= !PyGame on the HP Touchpad tablet = [[PageOutline]] [[Image(http://www.modrana.org/images/touchpad_pygame.jpg, 15%)]] 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 [http://thp.io/2011/webos/ WebOS page]. == Manual installation == === Prerequisites === Download the Python and !PyGame binaries from THPs [http://thp.io/2011/webos/ WebOS hacks] website:[[br]] [http://sourceforge.net/projects/webos-python/files/Python27/python27-webos.tgz/download Python 2.7 runtime][[br]] [http://sourceforge.net/projects/webos-python/files/Python27/pygame-1.9.1_py27-webos.tgz/download PyGame build for WebOS][[br]] [http://thp.io/2011/webos/python-webos_py27_2011-11-28.tgz Python bindings for WebOS] Download some !PyGame proggam that can be used to test if !PyGame is actually working. Possible candidates: * [http://www.rhodiumgames.com/rhodium-minis/thrifty-threesome-thriller/ Thrifty Threesome Thriller] * [http://thp.io/2011/webos/accelerometer.py accelerometer demo] * the THP provided files also include a simple testing file named ''example.py'' === 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:[[br]] [http://www.modrana.org/misc/pygame_bundle.zip 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 }}}