PyInstaller: Python のスクリプトを Windows 用の実行ファイル (exe形式) に変換する

[いやな日記][1] を参考に [py2exe][2] を使ってみると、hello.py を exe にしただけで distディレクトリのサイズは 2.04MB になった。
[いやな日記][1] では 1.2MB と書かれている。なんでだろ?

Python スクリプトを Windows 用の実行ファイルに変換するソフトには [py2exe][2] の他に [PyInstaller][3] というのがあるらしい。
早速試してみた。

[PyInstaller][3] のページから 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。

[1]: http://namazu.org/~satoru/diary/20040718.html
[2]: http://www.py2exe.org/
[3]: http://pyinstaller.hpcf.upr.edu/cgi-bin/trac.cgi/wiki

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください