Python Executables with cx_Freeze... | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 2

Python Executables with cx_Freeze...

Can someone post the layout or the basic structure of creating an executable in Python with cx_Freeze please? :)

28th Dec 2016, 4:39 PM
Thomas John
Thomas John - avatar
1 Resposta
0
For Windows with python 3.6: import sys from cx_Freeze import setup, Executable # Dependencies are automatically detected, but it might need fine tuning. build_exe_options = {"packages": ["os"], "excludes": ["tkinter"]} # GUI applications require a different base on Windows (the default is for a # console application). base = None if sys.platform == "win32": base = "Win32GUI" setup( name = "guifoo", version = "0.1", description = "My GUI application!", options = {"build_exe": build_exe_options}, executables = [Executable("guifoo.py", base=base)]) from: http://cx-freeze.readthedocs.io/en/latest/distutils.html Place the above code in setup.py. Then, open the command prompt in that folder (Shift+Right-Click), and use the following command python setup.py build Then, in the folder 'build', you should find a folder with your .exe. If you want to move it, you MUST move the whole folder, not just the .exe
29th May 2017, 4:32 AM
Cailyn Baksh