[1] Code:
import Tkinter
from Tkinter import *
root = Tkinter.Tk(className="test")
def openNotepad():
import pywinauto
app = pywinauto.Application.start("notepad.exe")
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)
root.mainloop()
[2] The code works if I double-click the .py file.
If I left only the openNotepad () function, then .exe will work.
According to docs: https://github.com/pyinstaller/pyinstaller/wiki/Supported-Packages , pywinauto library is supported.
If I leave only the Tkinter fragment, .exe will work.
So please share what I'm doing wrong, or suggest another python installer for python 2.7x.
source
share