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

Re: [pygame] Create an exe



David Holland wrote:
I am trying to create a standalone Windows exe for a
game that I have created following these instructions
:-
http://pygame.seul.org/ftp/pygame2exe.py

I wouldn't mess with pygame2exe -- I never got it to work. Try this:

In the main Python directory, run:

python setup.py py2exe

Where setup.py consists of:

# setup.py
from distutils.core import setup
import py2exe
setup(console=["MyProgram.py"])

And where all your .py files are in the main Python directory itself. First delete any existing "dist" and "build" directories, so that extra code doesn't get packaged into the program's library.zip. Some programs seem to require "FREESANSBOLD.TTF" in same directory as the EXE (when running) and possibly the code (when compiling); this is a Windows font. Once the program is compiled (it may give you warnings), put any extra files you need, like graphics, into the new "dist" directory and run the EXE there.

Kris