首先此问题为python3.7 已知未修复问题
解决途径有二:
- 更换python版本
- 加入修改代码
def fixed_map(option):
# Returns the style map for 'option' with any styles starting with
# ("!disabled", "!selected", ...) filtered out
# style.map() returns an empty list for missing options, so this should
# be future-safe
return [elm for elm in style.map("Treeview", query_opt=option)
if elm[:2] != ("!disabled", "!selected")]
style.map("Treeview",
foreground=fixed_map("foreground"),
background=fixed_map("background"))