class radiobar(frame)def __init__(selfparent=nonepicks=[]side=leftanchor= )frame __init__(selfparentself var stringvar(self var set(picks[ ]for pick in picksrad radiobutton(selftext=pickvalue=pickvariable=self varrad pack(side=sideanchor=anchorexpand=yesdef state(self)return self var get(if __name__ ='__main__'root tk(lng checkbar(root['python'' #''java'' ++']gui radiobar(root['win'' ''mac']side=topanchor=nwtgl checkbar(root['all']gui pack(side=leftfill=ylng pack(side=topfill=xtgl pack(side=leftlng config(relief=groovebd= gui config(relief=ridgebd= def allstates()print(gui state()lng state()tgl state()from quitter import quitter quitter(rootpack(side=rightbutton(roottext='peek'command=allstatespack(side=rightroot mainloop(to reuse these classes in your scriptsimport and call them with list of the options that you want to appear in bar of check buttons or radio buttons this module' selftest code at the bottom of the file gives further usage details it generates figure - - top-level window that embeds two checkbarsone radiobara quitter button to exitand peek button to show bar states--when this file is run as program instead of being imported figure - buttonbars self-test window running gui code three ways