いろいろ備忘録日記

主に .NET とか Go とか Flutter とか Python絡みのメモを公開しています。

Pythonメモ-19 (pyinstaller v3.3がリリース, python 3.6のサポート追加)

概要

pyinstallerのv3.3がリリースされました。ついに python 3.6 のサポートが追加!!

github.com

待ちわびてた人も多いのじゃないでしょうか。

使い方などは今までと同じです。

$ python -V
Python 3.6.1 :: Anaconda custom (x86_64)

# pyinstaller 入れていない場合は入れておく
$ pip install pyinstaller
# 既に pyinstaller 入っている場合は upgrade
$ pip install --upgrade pyinstaller

# サンプル用スクリプト作ってみる
$ cat helloworld.py
def __main():
  print('hello world')


if __name__ == '__main__':
  __main()

# pyinstaller使って standalone モジュール作成
$ pyinstaller --onefile helloworld.py

# distの下に出来上がり
$ cd dist
$ file helloworld
helloworld: Mach-O 64-bit executable x86_64
$ ./helloworld
helloworld

補足

PyQTなどのUIを持つアプリをpyinstallerで固める場合は以下の情報が参考になります。

qiita.com


過去の記事については、以下のページからご参照下さい。

サンプルコードは、以下の場所で公開しています。