exeファイル変換

python実行ファイル変換モジュール比較2 - Qiita

N@i.jp

qiita.com

WindowsでPythonにcx_Freezeをインストールする - batch-file - python-3.x | CODE Q&A [日本語]

・pip install だけだと、cxfreeze-quickstartが使えなくて。*.batをつくると、実行できるようになる。 cxfreeze-quickstartはsetup.pyのテンプレを作ってくれる。

・matplotをimportすると、importするだけでtclのライブラリを要求される。

cuiアプリ扱いならexeは問題なく作れた。numpy使っていてもOK

from cx_Freeze import setup, Executable
import numpy as np

# Dependencies are automatically detected, but it might need
# fine tuning.
buildOptions = dict(packages = ['numpy'], excludes = [])

base = 'Console'

executables = [
    Executable('mat.py', base=base)
]

setup(name='mat',
      version = '1',
      description = '',
      options = dict(build_exe = buildOptions),
      executables = executables)
#import matplotlib.pyplot as plt
import numpy as np

a=np.arange(100)
print(a)
#plt.plot(a)
#plt.show()