Apr-17-2019, 09:44 PM
cBox[0].config(**style(i))Use
[]
not ()
cBox[0].config(**style[i])
def test_config(font, fg, bg): print(font, fg, bg) style = [ {'font': ('Liberation Mono', 20, 'bold'), 'fg': 'red3', 'bg': 'pink'}, {'font': ('Liberation Mono', 20, 'normal'), 'fg': 'black', 'bg': 'dark goldenrod'}, {'font': ('Liberation Mono', 20, 'bold'), 'fg': 'dark goldenrod', 'bg': 'light yellow'}] test_config(**style[0]) test_config(**style[1]) test_config(**style[2])
Output:('Liberation Mono', 20, 'bold') red3 pink
('Liberation Mono', 20, 'normal') black dark goldenrod
('Liberation Mono', 20, 'bold') dark goldenrod light yellow