GP2X Very Bad Question


kfuse

Member
Joined
Jul 7, 2007
Messages
244
Okay I have that pygame beta on my f-200.

Im assuming the actual library is in that file but when I tried to to do import pygame it says.

Pygame module not found.

gotta be doing something wrong.

Right now I'm just running through basic python stuff. Since I guess vbScript is useless on gp2x which is what I knew.
 
garzyboi said:
Okay I have that pygame beta on my f-200.

Im assuming the actual library is in that file but when I tried to to do import pygame it says.

Pygame module not found.

gotta be doing something wrong.

Right now I'm just running through basic python stuff. Since I guess vbScript is useless on gp2x which is what I knew.
There's no such thing as a very bad question, just very bad people! :lol:
 
Last edited by a moderator:
yea well I just wasn't sure. I know the thing says plain pygame and python beta but if I can't pull up pygame then there is something I'm doing I dunno...guess I'll just keep working around in basic python till then
 
You have to set up your Python environment. If you want a piece of advice, create a mygame.gpe script that calls to your python script like this:

CODE

PYTHONHOME=/mnt/sd/utils/python
export PYTHONHOME

PYTHONPATH=${PYTHONHOME}/lib/python2.4/site-packages:$PYTHONPATH
PYTHONPATH=${PYTHONHOME}/lib/python24.zip:$PYTHONPATH
PYTHONPATH=${PYTHONHOME}/lib/python2.4/lib-dynload:$PYTHONPATH
PYTHONPATH=${PYTHONHOME}/lib/python2.4:$PYTHONPATH
PYTHONPATH=${PYTHONHOME}:$PYTHONPATH
export PYTHONPATH

LD_LIBRARY_PATH=${PYTHONHOME}/extras:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH

${PYTHONHOME}/python ./yourscript.py

cd /usr/gp2x
./gp2xmenu



Let me spam you: you can find my Gp2x Pygame/Python library and some demo games (tetris, pong, crashcolor) in http://globus.upc.es/~juanvvc/downloads/do...ile=libgp2x.zip
 
Here's a .gpe that lets you distribute the python install within your own project. This is for if you want to include python with any project you are distributing. I use it for my game retrovirus RTS. The python distribution goes inside a directory called data.

So, you'd have:

/yourgame/
/yourgame/data/
/yourgame/data/python/

and in /yourgame/yourgame.gpe you'd have:

CODE

PYTHONHOME=./data/python
export PYTHONHOME

PYTHONPATH=${PYTHONHOME}/lib/python2.4/site-packages:$PYTHONPATH
PYTHONPATH=${PYTHONHOME}/lib/python24.zip:$PYTHONPATH
PYTHONPATH=${PYTHONHOME}/lib/python2.4/lib-dynload:$PYTHONPATH
PYTHONPATH=${PYTHONHOME}/lib/python2.4:$PYTHONPATH
PYTHONPATH=${PYTHONHOME}:$PYTHONPATH
export PYTHONPATH

LD_LIBRARY_PATH=${PYTHONHOME}/extras:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH

./data/python/python -OO ./yourgame.py -p 2>error.txt

cd /usr/gp2x
./gp2xmenu



NOTE that the errors are all dumped in a file called error.txt for easy debugging.

Regards,
Luke
 
Back
Top