Pandora Distributing Python on the Pandora


TDT

Member
Joined
Aug 15, 2008
Messages
139
Hello all,


First time poster, but have been reading around the forum a fair bit. I currently don't own a pandora, but am on the next batch which hopefully I'll get within a few months. I was planning on spending a bit of time learning how to create games for the Pandora while i'm waiting.


I know Python, and have looked into PyGame in the past which is why I'm posting my questions here


1) How does one actually distribute a PyGame app on the store - some people may not be comfortable opening up a terminal and typing "python foo.py" to start the game. is there a way, easily, to distribute it in such a way where a menu item or an icon is made?


2) I heard that PyGame is pretty slow on the pandora due to the C-libraries issue. I was curious if it was good enough to make simple, say side scrolling games with relatively simple graphics?


3) Overall, if I'm just learning how to do this, is PyGame better to bother with, or should I just use the C-libraries and compile it for the pandora. Testing it may be a bit difficult, though...since I don't have a Pandora yet.


I looked for tutorials and anything else specific to development on the pandora, and haven't found a whole lot. Are there good resources I can reference and read more about this?


Thanks,


-David
 
1) The PND system is there for your user-friendly packaging needs. I'll help you there if needed.


2) SDL (the C lib pygame wrap) is fast enough for most job you want. One of tthe game I'm working on is redrawing everything (and every layers) on each frame but still manage an honorable 18-20fps


3) it's a matter of taste. If you like snakes(python), stay with them :)
 
Thanks for the quick reply, that definitely pointed me to some resources I haven't seen yet. It sounds easy enough, and glad I can begin working on the app already to prepare for when the pandora gets here.


Thanks again,


-David
 
Two things:


First of all, when it comes to Python, most everything is distributed using Distutils. You should learn how to use it; most distribution tasks are pretty straightforward. If you need some extra flexibility, you might consider Distribute (formerly Setuptools); it provides some extensions to Distutils, though I've never used it myself. If you stick with a Distutils-based setup script, it becomes easy to distribute your work in many forms and easy for users to install it. For example, if you use stdeb, you can produce Debian package files directly from your setup script, which can then be installed directly on the Pandora (since deb files are identical to the ipk files used by opkg).


Secondly, it's funny you bring this up because, just yesterday, I started on my own Distutils extension designed to build PND files directly from the setup script. distPND is nowhere close to ready yet (I wasn't planning to announce it, but you asked), but the idea is, once your setup script is ready, a single command to it will package your project up in a PND.


So in conclusion, make a setup script for your program, and everything else will be easy.
 
Secondly, it's funny you bring this up because, just yesterday, I started on my own Distutils extension designed to build PND files directly from the setup script. distPND is nowhere close to ready yet (I wasn't planning to announce it, but you asked), but the idea is, once your setup script is ready, a single command to it will package your project up in a PND.
Good news.


BTW: do you have an idea on how to use setupTools to cross-compiles modules (I mean binaries modules, .pyc are portable anyway) ? So far setupTools isn't my friend at all...
 
BTW: do you have an idea on how to use setupTools to cross-compiles modules (I mean binaries modules, .pyc are portable anyway) ? So far setupTools isn't my friend at all...
That I don't know. The package index has something called distutilscross that might work, though it looks old. Otherwise, I imagine that most Python packages don't have huge extension modules needing compiling, so maybe it would be easiest to do on the Pandora.


distPND won't include anything for cross-compiling, but should, I hope, work well alongside other Distutils-based commands.
 
Two things:


First of all, when it comes to Python, most everything is distributed using Distutils.
Would this not have a tendency to install things into NAND?


@Sebt3: I thought that the .pyc files were (re)created on the first run of module. Best not distribute them and let the local Python interpretor create them.


Regarding SDL: I think it is SDL that is slow and needs some Dev TLC not pygame.
 
Would this not have a tendency to install things into NAND?
It would if users ran "python setup.py install", but I'm not saying that Pandora users should be doing that to install Python programs. If using Distutils, it becomes easy for the developer to create a variety of user-friendly binary distributions, like RPMs, DEBs, and PNDs (at least, PNDs will be doable once I finish distPND).

Regarding SDL: I think it is SDL that is slow and needs some Dev TLC not pygame.
That's my understanding too. I've heard Pygame described as a paper-thin wrapper around SDL, so Pygame shouldn't add much latency not already found in SDL.
 
Back
Top