python --> pyinstaller - .exe file will return “test returned -1”
问题 [1] The code is: import Tkinter from Tkinter import * # Create Tk instance root = Tkinter.Tk(className="test") # Open Notepad def openNotepad(): import pywinauto app = pywinauto.Application.start("notepad.exe") # Add menu menu = Menu(root) root.config(menu=menu) filemenu = Menu(menu) menu.add_cascade(label="01 File", menu=filemenu) filemenu.add_command(label="New", command=openNotepad) # Pack all root.mainloop() [2] The code works if I double click on .py file. If I leave only the openNotepad