惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
H
Help Net Security
N
Netflix TechBlog - Medium
Apple Machine Learning Research
Apple Machine Learning Research
P
Proofpoint News Feed
A
About on SuperTechFans
V
V2EX
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
宝玉的分享
宝玉的分享
aimingoo的专栏
aimingoo的专栏
F
Fortinet All Blogs
博客园 - 【当耐特】
Microsoft Security Blog
Microsoft Security Blog
Martin Fowler
Martin Fowler
I
InfoQ
Google DeepMind News
Google DeepMind News
人人都是产品经理
人人都是产品经理
Engineering at Meta
Engineering at Meta
腾讯CDC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog RSS Feed
U
Unit 42
The Cloudflare Blog
Y
Y Combinator Blog

博客园 - 吴尔平

gtest 的彩色信息输出 + boost.test 的内存泄漏检测及定位 在低版本的 vc 中使用 vc 10.0 的新特性 使用另一个blog: http://blog.csdn.net/WuErPing scons + swig 如何在 vista 使用 Device Emulator 连接internet vc9 Feature Pack Beta tr1 的一些问题 NSIS Kill Process (转贴) C#与一个彩票页面 - 吴尔平 - 博客园 关于模板化的friend class C# 的 random shuffle python 读取 windows event log 的简短代码 IronPython 1.0 Release Candidate (转贴 ( 据说比c实现的快1.5!) ) Visual Studio Service Pack (转贴) The 16th Annual Jolt Product Excellence Award Winners (转贴) C++/CLI FAQ (逐步整理中) C++/CLI singleton模式 (双重检测锁实现) 如何在 VS2005 的 Team Unit Testing frameworks 中测试 Native Code (C++ ) 2005 CRT memory leaks 改变 SQL Server 2000 所有对象的所有者
py2exe 转换 pytetris - 吴尔平
吴尔平 · 2007-12-02 · via 博客园 - 吴尔平

首先,需要一个给 py2exe 使用的 python 脚本,我命名为 setup.py,内容如下:

1from distutils.core import setup
2import glob, shutil
3import py2exe
4setup(windows=["main.py"])
5shutil.copytree('SFX''dist/SFX')
6shutil.copytree('Image''dist/Image')
7shutil.copyfile('C:/Python25/Lib/site-packages/pygame/freesansbold.ttf''dist/freesansbold.ttf')


并对 main.py 做简单的处理

1#font = pygame.font.Font(None, 40)
2 font = pygame.font.Font('freesansbold.ttf'40)


最后,执行如下命令:

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/