windows componentwindow __init__(selfpymailserver __init__(selfclass pymailfilewindow(pymailfilewindows popupwindow)" toplevelwith extra protocol and mixed-in methodsdef __init__(selffilename)windows popupwindow __init__(selfappnamefilenamepymailfile __init__(selffilename##############################################################################when run as top-level programcreate main mail-server list window ##############################################################################if __name__ ='__main__'rootwin pymailserverwindow(if len(sys argv for savename in sys argv[ :]rootwin onopenmailfile(savenamerootwin lift(rootwin mainloop(open server window fix to add len(open save file windows (demosave files loaded in threads sharednamesprogram-wide globals the module in example - implements sharedsystem-wide namespace that collects resources used in most modules in the system and defines global objects that span files this allows other files to avoid redundantly repeating common imports and encapsulates the locations of package importsit is the only file that must be updated if paths change in the future using globals can make programs more difficult to understand in general (the source of some names is not as clear)but it is reasonable if all such names are collected in single expected module such as this onebecause there is only one place to search for unknown names example - pp \internet\email\pymailgui\sharednames py ""#############################################################################objects shared by all window classes and main fileprogram-wide globals #############################################################################""used in all windowicon titles appname 'pymailgui used for list saveopendeletealso for sent messages file savemailseparator 'pymailgui('-'* 'pymailgui\ncurrently viewed mail save filesalso for sent-mail file opensavefiles { window per file,{name:winstandard library services import sysosemail utilsemail messagewebbrowsermimetypes the pymailgui client