1
from distutils.core import setup
2
import glob, shutil
3
import py2exe
4
setup(windows=["main.py"])
5
shutil.copytree('SFX', 'dist/SFX')
6
shutil.copytree('Image', 'dist/Image')
7
shutil.copyfile('C:/Python25/Lib/site-packages/pygame/freesansbold.ttf', 'dist/freesansbold.ttf')
2
3
4
5
6
7
并对 main.py 做简单的处理
1
#font = pygame.font.Font(None, 40)
2
font = pygame.font.Font('freesansbold.ttf', 40)
2
最后,执行如下命令:
python setup.py py2exe
.........................................................
关于 py2exe
简介
py2exe is a Python Distutils extension which converts Python scripts into executable Windows programs, able to run without requiring a Python installation.
下载
http://sourceforge.net/projects/py2exe/