Application created with tkinter and cx_freeze opens and closes immediately

0

I have an application created with tkinter, python3.6 and packaged with cx_freeze with the following file setup.py:

import os
from cx_Freeze import setup, Executable

os.environ['TCL_LIBRARY'] = "C:\Users\Alfredo\Anaconda3\tcl\tcl8.6"
os.environ['TK_LIBRARY'] = "C:\Users\Alfredo\Anaconda3\tcl\tk8.6"

buildOptions = dict(
    packages = ['events', 'numpy', 'pandas', 'datetime','matplotlib'],
    excludes = [],
    include_files=['tcl86t.lib', 'tk86t.lib', 'images', 'Usuarios.xlsx']   
)

import sys
base = 'Win32GUI' if sys.platform=='win32' else None

executables = [
    Executable('main.py', base=base, icon = "images/icon.ico")
]

setup(name='editor',
      version = '1.0',
      description = '',
      options = dict(build_exe = buildOptions),
      executables = executables)

Well, the problem is that it generates me the .exe without apparent errors but when I execute it the window opens and closes instantly. I can not see any error message Any solution?? How can I launch it from the console to see the errors it returns?

Thank you.

    
asked by Alfredo Lopez Rodes 14.07.2018 в 09:22
source

1 answer

0

To see the errors it shows you when you run your .exe, do it through the console. If your file is called editor.exe, open the windows console (cmd) in the directory where your executable is and run: editor.exe

There, the errors that appear appear in console.

Greetings.

    
answered by 08.10.2018 в 20:14