method--so that the classes in this module can also be used to generate callback handlers in tkinter-based guis as we'll see in the upcoming button-presses in tkinter invoke callable object with no argumentsby registering portablelauncher instance to handle the press eventwe can automatically start new program from another program' gui gui might associate launcher with gui' button press with code like thisbutton(roottext=namecommand=portablelauncher(namecommandline)when run standalonethis module' selftest function is invoked as usual as codedsystem blocks the caller until the program exitsbut portablelauncher (reallyspawn or forkand start do notc:\pp etype echo py print('spam'input('press enter' :\pp epython launchmodes py default mode echo py system mode echo py spam press enter dos start mode echo py as more practical applicationsthis file is also used in to launch gui dialog demos independentlyand again in number of ' examplesincluding pydemos and pygadgets--launcher scripts designed to run major examples in this book in portable fashionwhich live at the top of this book' examples distribution directory because these launcher scripts simply import portablelauncher and register instances to respond to gui eventsthey run on both windows and unix unchanged (tkinter' portability helpstooof coursethe pygadgets script even customizes portablelauncher to update gui label at start timeclass launcher(launchmodes portablelauncher)def announce(selftext)info config(text=textuse wrapped launcher class customize to set gui label we'll explore these two client scriptsand otherssuch as ' pyedit after we start coding guis in part iii partly because of its role in pyeditthis edition extends this module to automatically replace forward slashes with backward slashes in the script' file path name pyedit uses forward slashes in some filenames because they are allowed in file opens on windowsbut some windows launcher tools require the backslash form instead specificallysystempopenand startfile in os require backslashesbut spawnv does not pyedit and others inherit the new pathname fix of fixwindowspath here simply by importing and using this module' classespyedit portable program-launch framework