Skip to content

Instantly share code, notes, and snippets.

@CarMoreno
Created December 2, 2015 00:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CarMoreno/c7fc609df08a51d39c55 to your computer and use it in GitHub Desktop.
Save CarMoreno/c7fc609df08a51d39c55 to your computer and use it in GitHub Desktop.
Archivos ejecutables en Python 3.x con cx_Freeze.
import sys
from cx_Freeze import setup, Executable
# base por defecto está para trabajar con apps de consola, en nuestro caso queremos una app gráfica
# si la plataforma es windows, entonces seteamos base a Win32GUI
if sys.platform == "win32":
base = "Win32GUI"
ejecutables = [Executable(
"main.pyw", #El archivo desde donde corre tu aplicacion
base = base, #Si no te funciona y estás en windows, intenta: base = "Win32GUI"
targetName = "Vibora.exe",
)]
setup(
name = "name_you_app",
version = "1.0",
options = {
"build_exe":{
"include_files":["images/"]}#Mi aplicacion hace uso de imagenes, dentro del arreglo podes poner tambien rutas a fonts y demas
},
executables = ejecutables
)
# Si tienes problemas luego de generar el archivo y te sale el siguiente error:
# AttributeError 'module' object has no attribute '_fix_up_module', dirigete a:
# http://stackoverflow.com/questions/23920073/cx-freeze-error-python-34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment