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

Re: [pygame] Binary distribution woes



On Thu, Sep 21, 2006 at 01:36:28PM +0100, Michael Brunton-Spall wrote:
> Hi all,
> 
> My game is coming along nicely, and my artist said he'd like to try it
> out.  He runs Mac OSX, so I figured it would be a good chance to try out
> the cross platform abilities of python / pygame.
> Well after a lot of fiddling and installing the new python2.4 and pygame
> packages, we got the game to work, but to run the game I had to manually
> install those packages, and bring up a console, and run the correct
> python interpreter on my Game.py.
> Suffice to say it ran buetifully, (Thanks pygame!), but thats not really
> a great way of distribution a finished game.  My artist didn't even know
> he had a console and he certianly couldn't use it to run the game.
> We tried double clicking on the py file but it openes in the default
> python ide instead of running it.
> 
> So I did some digging today, looking at py2app, py2exe, and the
> disttools package, ez_setup etc.
> It seems incredibly complicated to try to build a binary file.
> 
> What I want isn't too complicated really.  (or at least I didn't think
> so), I want to be able to build 3 single files, one for MacOSX, one for
> unix, and one for Windows.  Each should contain my game resources, and
> have an icon/application file that is double clickable to start the
> game.
> 
> Surely some of the people using pygame here have needed to do this at
> some point, and I wondered, given the lack of other information, how
> does one approach doing that?
> 
> Cheers
> 
> Michael Brunton-Spall
> MIB Games

Py2app works great. I have used it on several occasions, both to package 
my own stuff and to package other peoples stuff. If your game is 
open-source I would be glad to write a py2app setup.py file for you.

If your app is closed source, and you want to do it yourself, I can at 
least show you an example:


"""
setup.py for robohunt, run with:
% python setup.py py2app
 
For the list of available commands, see:
% python setup.py py2app --help
"""

from distutils.core import setup
import py2app

setup(
    name = "robohunt",
    app = ['run.py'],
    data_files = [('',
          ['./images',
           './sound'],
          )]
    )





---
James Paige