I\'m trying to convert a fairly simple Python program to an executable and couldn\'t find what I was looking for, so I have a few questions (I\'m running Python 3.6):
Steps to convert .py to .exe in Python 3.6
pip install cx_Freeze.pip install idna..py program named myfirstprog.py.setup.py on the current directory of your script.setup.py file, copy the code below and save it.python setup.py buildbuild. It has another folder in it. Within that folder you can find your application. Run it. Make yourself happy.See the original script in my blog.
setup.py:
from cx_Freeze import setup, Executable
base = None
executables = [Executable("myfirstprog.py", base=base)]
packages = ["idna"]
options = {
'build_exe': {
'packages':packages,
},
}
setup(
name = "",
options = options,
version = "",
description = '',
executables = executables
)
EDIT:
myfirstprog.py you should put your .pyextension file name as created in step 4;imported package in your .py into packages list (ex: packages = ["idna", "os","sys"])any name, any number, any description in setup.py file should not remain the same, you should change it accordingly (ex:name = "", version = "0.11", description = '' )imported packages must be installed before you start step 8.