Where to start looking in the code when your .exe doesn't work after cx_freeze?

↘锁芯ラ 提交于 2019-12-11 07:17:05

问题


So I've been working a while on a tkinter program that kills windows explorer and pulls up a dialogue box with an image, button, and canvas.

So I got the python script itself to work. But when I try to compile it with cx_Freeze for use on my other 64 bit windows computer, and then run it, nothing happens. No errors, no dialogue messages, nothing. Just a loading animation over the cursor for a few seconds before it stops.

I made a batch file that pauses the application before it finishes in hopes of finding an error that I may have missed:

my-application-name.exe %1

PAUSE

This gave me no info on what might be preventing this program to work.

So my question is, since there is no obvious solution, when a tkinter python application doesn't work at all and behaves like this, where in the code would I look to find the cause of it not working? It has to be in the setup.py file I used for cx_Freeze, since the Python script works without it, right?

Here is my setup.py code used to compile with cx_Freeze:

import sys, os
from cx_Freeze import setup, Executable

base = None
if sys.platform == 'win32':
  base = 'Win32GUI'

os.environ['TCL_LIBRARY'] = 
r'C:\Users\jbond\AppData\Local\Programs\Python\Python36\tcl\tcl8.6'
os.environ['TK_LIBRARY'] = 
r'C:/Users/jbond/AppData/Local/Programs/Python/Python36/tcl/tk8.6'


executables = [
   Executable('brrf.py', base=base)
]

setup(name='simple_Tkinter',
    version='0.1',
    description='Sample cx_Freeze Tkinter script',
    executables=executables
    )

Thanks for any help.

来源:https://stackoverflow.com/questions/48177683/where-to-start-looking-in-the-code-when-your-exe-doesnt-work-after-cx-freeze

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!