実行ファイルを作るbbfreeze0.92.0
概要
なるほど。ではインストール。
Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:?Documents and Settings?user>easy_install bbfreeze Searching for bbfreeze Reading http://cheeseshop.python.org/pypi/bbfreeze/ Reading http://systemexit.de/bbfreeze/ Reading http://cheeseshop.python.org/pypi/bbfreeze/0.92.0 Best match: bbfreeze 0.92.0 (中略) Installed c:?python25?lib?site-packages?altgraph-0.6.7-py2.5.egg
Helloworldを書いてみる
#coding:cp932 def HelloWorld(): print "Hello World!" print u'こんにちは世界' if __name__=="__main__": HelloWorld()
使ってみる
cd C:??temp C:??temp>python Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win 32 Type "help", "copyright", "credits" or "license" for more information. >>> from bbfreeze import Freezer using binary dependency cache in 'C:??Documents and Settings??user??Applicatio n Data??bbfreeze??cache' >>> f=Freezer("helloworld-1.0") >>> f.addScript("hello.py") >>> f() *** applied実行例
C:??temp??helloworld-1.0??hello.exe Hello World! こんにちは世界
*1:うちの環境はsys.setdefaultencoding = 'cp932'なので参考になるか分かりませんが