def __init__(selfconfig=clockconfigparent=nonename='')clock __init__(selfconfigparentself pack(expand=yesfill=bothtitle appname if nametitle appname name self master title(titlemaster=parent or default self master protocol('wm_delete_window'self quit##############################################################################program run ##############################################################################if __name__ ='__main__'def getoptions(configargv)for attr in dir(clockconfig)fill default config objtryfrom "-attr valcmd args ix argv index('-attrwill skip __x__ internals exceptcontinue elseif ix in range( len(argv)- )if type(getattr(clockconfigattr)=intsetattr(configattrint(argv[ix+ ])elsesetattr(configattrargv[ix+ ]#config photoclockconfig(config clockconfig(if len(sys argv> getoptions(configsys argvclock py -size -bg 'blue#myclock clockwindow(configtk()parent is tk root if standalone #myclock clockpopup(clockconfig()'popup'myclock clockmain(configmyclock mainloop(and finallyexample - shows the module that is actually run from the pydemos launcher script--it predefines handful of clock styles and runs seven of them at onceattached to new top-level windows for demo effect (though one clock per screen is usually enough in practiceeven for me!example - pp \gui\clock\clockstyles py precoded clock configuration styles from clock import from tkinter import mainloop gifdir /gifs/if __name__ ='__main__'from sys import argv if len(argv gifdir argv[ '/ complete gui programs