Nov-08-2017, 08:30 PM
I'm having a terrible time trying to incorporate getting to the temp MEIPASS file in this section for bundling with Pyinstaller. Pyinstaller makes the exe, but it fails when running. It isn't finding the .gif files. Any changes to the "for i xrange" section causes indent errors. Any incorporation of os.path.join(sys._MEIPASS, relative) anywhere causes errors also. Is there a better way to do the button .gif files to incorporate MEIPASS? (Code also uses Tkinter.)
def addConfigBtn(self, login): # Creating temp references to images using temp1,2,3 so as to disallow # garbage collection problems btnList = ["Add", "List", "Search"] btnCmdList = [lambda: Add.AddWindow(self), lambda: List.ListWindow(self), lambda: Search.SearchWindow(self)] f = # Frames array img = # image array self.temp = # temp array for i in xrange(3): f.append(Frame(login, padx=2, width=50, height=50)) f[i].grid(row=3, column=i) img.append(PhotoImage( file=btnList[i] + ".gif", width=48, height=48)) self.temp.append(img[i]) ttk.Button(f[i], image=img[i], text=btnList[i], compound="top", style="Submit.TButton", command=btnCmdList[i]).grid(sticky="NWSE")[/i][/i][/i][/i][/i][/i][/i]