PSP Python Install Guide
FIXME This is obsolete. I'll rewrite it ASAP, in the meantime, the quick way is:
- Get the source (svn://python-psp.net/python/trunk)
- Build cpplibs
- Build imaging
- Go to python/PSP and type "make"
If you have all dependencies installed, it should be enough...
Where to get it
The latest binary is available from the Wiki front page.
This consists of the EBOOT.PBP and the standard library, psp.zip. Install EBOOT.PBP the usual way, using KXploit or something else. Unzip psp.zip to ms0:/python.
For those who want to fiddle with the source, go on reading.
Building Python for PSP
I only tested the build on Linux, always using the latest PSP SDK and toolchain. First, build and install the following libraries:
- zlib
- libpng
- mikmodlib
- jpeg
- sqlite
- openssl
- bzip2
- libTremor
- libmad
These libs are in the PS2DEV Subversion repository at
svn://svn.ps2dev.org/psp/trunk
Next, build and install cpplibs, available here (Subversion repository):
svn://fraca7.homeunix.net/python/trunk/cpplibs/
Finally, get the Python-PSP source here (Subversion repository):
svn://fraca7.homeunix.net/python/trunk/python/
At this stage, you may choose to build either the 'regular' Python-PSP with psp2d, pspsnd and pspnet modules, or the one with the OSLib binding. Edit trunk/python/PSP/Makefile. At the start of the makefile, you may enable or disable each module (WITH_ variables). Note that I've only tested with OSLib alone or with all the modules except OSLib. Mixing them may lead to surprises.
To build with OSLib support, you must have it installed.
cd to trunk/python/PSP and type 'make'. It's done. Hopefully.
Windows installation will be uploaded soon...
Getting the standard library
Python for PSP's site-packages directory is actually ms0:/python. So in order to use the standard library, you'll have to copy trunk/python/Lib/* to ms0:/python/.
Running scripts
Once EBOOT.PBP is installed on your Memory Stick, you can run it as any homebrew. When launched, the interpreter will try to find a "script.py" file in its directory and run it; if there is none, it will exit with an error message.
Standard modules
In addition to the regular built-ins and the PSP-specific modules, the following standard modules are available:
- time
- math
- struct
- binascii
- _random
- cStringIO
- errno
- thread
- collections
- md5
- socket
- select
In order to use the pure Python modules from the standard library, copy the contents of the python/Lib source directory in a directory named 'python' at the root of your memory stick. For users who don't have access to the source through Subversion, you can download the content of this directory as a psp.zip file in the Releases section.
Additionnal modules
PSP-specific APIs are partially wrapped; for now it's better to use the higher-level API in the psp2d module. The Subversion repository also includes some samples.
