""############################################################################## "mixinclass for other framescommon methods for canned dialogsspawning programssimple text viewersetcthis class must be mixed with frame (or subclass derived from framefor its quit method ##############################################################################""from tkinter import from tkinter messagebox import from tkinter filedialog import from pp gui tour scrolledtext import scrolledtext from pp launchmodes import portablelaunchersystem or tkinter scrolledtext or use multiprocessing class guimixindef infobox(selftitletext*args)return showinfo(titletextuse standard dialogs *args for bkwd compat def errorbox(selftext)showerror('error!'textdef question(selftitletext*args)return askyesno(titletextreturn true or false def notdone(self)showerror('not implemented''option not available'def quit(self)ans self question('verify quit''are you sure you want to quit?'if ansframe quit(selfquit not recursivedef help(self)self infobox('rtfm''see figure 'override this better def selectopenfile(selffile=""dir=")use standard dialogs return askopenfilename(initialdir=dirinitialfile=filedef selectsavefile(selffile=""dir=")return asksaveasfilename(initialfile=fileinitialdir=dirdef clone(selfargs=())new toplevel(myclass self __class__ myclass(new*argsoptional constructor args make new in-process version of me instance' (lowestclass object attach/run instance to new window def spawn(selfpycmdlinewait=false)if not waitportablelauncher(pycmdlinepycmdline)(elsesystem(pycmdlinepycmdline)(def browser(selffilename)new toplevel( gui coding techniques start new process run python progam wait for it to exit make new window