[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] python + pygame on OSX



On Feb 21, 2004, at 8:38 PM, Pete Shinners wrote:

enrike wrote:
i would like to hear comments from people using python + pygame on OSX. I am interested on knowing about portability. I should be working on windows or linux and then port to OSX.
I am not sure how difficult porting to osx is. I would like to know as well about dependencies, compatibilities etc..
I don't know where you can find a good explanation. For the most part a pygame game just works on OSX. Solarwolf ran on the macs with no changes at all. I think the biggest thing to keep in mind is file paths. But if your game already handles the path differences between windows and linux, it should be clean enough to run on OSX.
Building self-contained applications on OS X that use pygame is currently a difficult matter, and getting pygame installed can be difficult for some (you actually need to read the Package Manager directions.. because some directory permissions need to be changed from the system default in order to install pygame).

If you would like an OS X port of your pygame application, let me know. I'm not going to write a tutorial about how to do it, because I'm working on the software that will make it easy.. but in the meantime I will probably do it for you if you ask, mainly because it helps me test my packaging software with random bits of code not designed specifically to use it ;)

Stuff you should avoid if possible are:
runtime additions to sys.path
intermingling of code and data (keep them in separate folders, please)
using __file__ or similar mechanisms to find data (really a subissue of the previous)

pygame does two of these things on its own, so that's one reason why it's not particularly easy. I think I'm going to workaround these issues for packages by having an online database of packaging hints (f.ex. there will be an XML file on pythonmac.org and/or undefined.org that says "pygame needs its .ttf, and must not use the zip import hook"). When the software is ready and the database is populated, applications that don't break the three rules above should be package-able with almost no effort.

-bob