run startargs if cmdargs else start run(thecmdthecmd)(elsefork(thecmdthecmd)(os chdir(mycwdspawn in parallel support args or always spawn spawn in parallel go back to my dir def onpickfont(self)"" non-modal font spec dialog pass per-dialog inputs to callbackmay be font dialog open ""from pp gui shellgui formrows import makeformrow popup toplevel(selfpopup title('pyedit font'var makeformrow(popuplabel='family'browse=falsevar makeformrow(popuplabel='size'browse=falsevar makeformrow(popuplabel='style'browse=falsevar set('courier'var set(' 'suggested vals var set('bold italic'see pick list for valid inputs button(popuptext='apply'commandlambdaself ondofont(var get()var get()var get())pack(def ondofont(selffamilysizestyle)tryself text config(font=(familyint(size)style)exceptshowerror('pyedit''bad font specification'###########################################################################utilitiesuseful outside this class ###########################################################################def isempty(self)return not self getalltext(def getalltext(self)return self text get(' 'end+'- 'extract text as str string def setalltext(selftext)""callercall self update(first if just packedelse the initial position may be at line not line ( tk bug?""self text delete(' 'endstore text string in widget self text insert(endtextor ' 'text=bytes or str self text mark_set(insert' 'move insert point to top self text see(insertscroll to topinsert set def clearalltext(self)self text delete(' 'endclear text in widget def getfilename(self)return self currfile def setfilename(selfname) complete gui programs see alsoongoto(linenum