Pygame Compiled?


jbess

Still Fresh
Joined
Nov 20, 2006
Messages
50
I have coded several Windows programs in python, and used py2exe to compile into an executable that does not need python installed to run. Is this remotely possible with a GP2X? Sorry, programming languages are still relatively new to me, so if it's a dumb question, let me know =).
 
Just download the GP2X python + pygame I made and install it to your sd card. You can run your programs by making a GPE file or through telnet.

Here's an example GPE file:
Code:
#!/bin/sh

export PYTHONHOME=/mnt/sd/python
export PATH=$PATH:$PYTHONHOME

python game.py

cd /usr/gp2x
exec gp2xmenu
 
Blah posted on Dec 27 2006 at 09:30 PM said:
Just download the GP2X python + pygame I made and install it to your sd card. You can run your programs by making a GPE file or through telnet.

Here's an example GPE file:
Code:
#!/bin/sh

export PYTHONHOME=/mnt/sd/python
export PATH=$PATH:$PYTHONHOME

python game.py

cd /usr/gp2x
exec gp2xmenu


I've made a few programs already using that method. But I would like to compile my python programs, so the run faster, and do not require python to be installed. I am struggling between using python and fenix. Fenix seems easier to code just for games, but I am used to python, and feel I can do more with it, not JUST games. I've read posts that say that python is slow, and I should use fenix. I guess I am just being stubborn, and trying to prove them wrong! :rolleyes:
 
Last edited by a moderator:
Hmm... There is really no way to compile python into a executable. Well, you could make an executable that runs the scripts in libpython with the scripts linked in as data, but that wouldn't be any faster. But python on the GP2X is certainly fast enough for games, see RetrovirusRTS for example. I am working on a project for the GP2X right now using python and its going pretty good. Once I'm done you can use my special cross-platform input library (aka LibGismo) in your projects if you wish.
 
Blah posted on Dec 28 2006 at 03:46 PM said:
Hmm... There is really no way to compile python into a executable. Well, you could make an executable that runs the scripts in libpython with the scripts linked in as data, but that wouldn't be any faster. But python on the GP2X is certainly fast enough for games, see RetrovirusRTS for example. I am working on a project for the GP2X right now using python and its going pretty good. Once I'm done you can use my special cross-platform input library (aka LibGismo) in your projects if you wish.

Alright. Thanks for the confirmation.
 
Last edited by a moderator:
I've just recently started learning the basics of Python. I have almost no programming experience so I choose to learn one language only. It's available for all platforms I can think of, so the newbie crappy code I will write can be improved until eternity.

Too bad something like py2ex isn't possible for Linux.
 
Blah posted on Dec 28 2006 at 10:46 PM said:
Hmm... There is really no way to compile python into a executable. Well, you could make an executable that runs the scripts in libpython with the scripts linked in as data, but that wouldn't be any faster. But python on the GP2X is certainly fast enough for games,
hi blah,
i think this might do what you are suggesting,
http://wiki.python.org/moin/Freeze
no speed gain, but its a standalone executable for convenience.
 
Last edited by a moderator:
poddy posted on Dec 28 2006 at 05:12 PM said:
hi blah,
i think this might do what you are suggesting,
http://wiki.python.org/moin/Freeze
no speed gain, but its a standalone executable for convenience.

I tried it, but it's missing several modules, and a few other errors came up. Don't have the patience for it I guess. I'm thinking the stripped down version of python for the GP2X will be unable to compile. In case you are interested, here is info on freeze (the best place I could find it).

http://ftp.cwi.nl/jack/freeze/
 
Last edited by a moderator:
I've installed and tried http://www.cxtools.net/default.aspx?nav=cxfrlb in Ubuntu. Works pretty straightforward there and I created a nice 'hello world' binary.
Tried to execute the binary with sterm on my gp2x and that didn't work (but that wasn't a very big suprise).

Didn't dare installing cx freeze on the gp2x, I'm sure I will run into lots of problems.
 
from what i can tell it has to be targetting the correct version of python, ie. target version (blah's arm version) not your x86 development version.
 
Blah posted on Dec 28 2006 at 11:00 PM said:
The version I made is not stripped down.

I meant no offense. ;) Just that there are modules that are not installed on my GP2X that are present on my XP installation, such as evident on me attempt to use freeze.
 
Last edited by a moderator:
Back
Top