Create single exe from Python 3.6 scripts in CX_Freeze -
i have python script compile single executable file, have read pyinstaller best option unfortunately cx_freeze compiler have found work python 3.6.
is there way cx_freeze?
first must have cx_freeze 5.0.1 supports python 3.6 .
then,it's 3.x version . put code in setup.py file , replace :
"prog.py"
with main script name.
take care , don't forgit if go console should
if sys.platform == "win32": base = "console"
here code :
import sys cx_freeze import setup, executable # dependencies automatically detected, might need fine tuning. build_exe_options = {"packages": ["os"], "excludes": ["tkinter"]} # gui applications require different base on windows (the default # console application). base = none if sys.platform == "win32": base = "win32gui" setup( name = "my prog", version = "1.0", description = "my application!", options = {"build_exe": build_exe_options}, executables = [executable("prog.py", base = base)])
open command prompot write :
cd directory path python setup.py build
Comments
Post a Comment