Note that there are some explanatory texts on larger screens.

plurals
  1. POPython py2exe window showing (tkinter)
    primarykey
    data
    text
    <p>I'm trying to make an exe by py2exe. The program is showing a popup-like window using Tkinter. The problem is, everything works fine when I run the setup like this:</p> <pre><code>setup(windows = [{'script': "msg.py"}], zipfile = None) </code></pre> <p>but it fails when I try to make an one-file exe:</p> <pre><code>setup(windows = [{'script': "msg.py"}], zipfile = None, options = {'py2exe': {'bundle_files': 1, 'compressed': True}}) </code></pre> <p>Actually the final exe runs without problems, but it doesn't display any window. I've read there may be problems with bundle_files=1 at Windows 7, but I also tried bundle_files=2 with the same effect. Here is my msg.py script:</p> <pre><code>from win32gui import FindWindow, SetForegroundWindow from Image import open as iopen from ImageTk import PhotoImage from Tkinter import Tk, Label from threading import Timer from subprocess import Popen import os def Thread(t, fun, arg=None): if arg&lt;&gt;None: x = Timer(t, fun, arg) else: x = Timer(t, fun) x.daemon = True x.start() def NewMessage(): global root if not os.path.exists('dane/MSG'): open('dane/MSG', 'w').write('') root = Tk() img = PhotoImage(iopen("incl/nowa.png")) label = Label(root, image=img) label.image = img label.bind("&lt;Button-1&gt;", Click) label.pack() root.geometry('-0-40') root.wm_attributes("-topmost", 1) root.overrideredirect(1) root.mainloop() def Click(event): global root, exit root.destroy() os.remove('dane/MSG') OpenApp() exit = True def OpenApp(): hwnd = FindWindow(None, 'My program name') if hwnd: SetForegroundWindow(hwnd) else: Popen('app.exe') root, exit = None, False NewMessage() </code></pre> <p>Any ideas? I've read there are some problems with Tkinter, but there were about compilation. My script is compiled and it doesn't throw any exceptions, but doesn't show the window...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload