pythonネイティブ作成環境の構築

pythonネイティブ作成環境の構築

Python 3.4.4(~3.4までがXP対応、3.4.4バイナリ配布あり)

https://www.python.org/downloads/release/python-344/

・PyInstaller 3.4が最新版

https://github.com/pyinstaller/pyinstaller/releases

 

手順

Pythonインストール

→Path登録をオンにする

コマンドプロンプトpython実行可能

pyinstallerインストール

> py -m pip install pyinstaller

完了

 

※pipをアップデートしろというメッセージが流れるがどうなんだろう?

7.1.2→19.0.2

サンプル実行

<hello.py>

print ("Hello, world!")

 

> py hello.py

無事実行できたので、これをバイナリに変換

>pyinstaller hello.py --onefile --noconsole

実行

> dist\hello.exe

→何も出力されずに終了、コンソールアプリはコンソール切っちゃいけないのかも

>pyinstaller hello.py --onefile

> dist\hello.exe

コマンドラインと別ウィンドウに文字出力されて終了