いやな日記 を参考に py2exe を使ってみると、hello.py を exe にしただけで distディレクトリのサイズは 2.04MB になった。 いやな日記 では 1.2MB と書かれている。なんでだろ?
Python スクリプトを Windows 用の実行ファイルに変換するソフトには py2exe の他に PyInstaller というのがあるらしい。 早速試してみた。
PyInstaller のページから PyInstaller 1.0 をダウンロードしてを展開する。
cd pyinstaller_1.0
python Configure.py
hello.py を作成する
print "hello, world"
実行ファイルを作成する
python Makespec.py hello.py
python Build.py ./hello/hello.spec
disthelloディレクトリのサイズは 1.41MB。