-1
我想設置一個框架的背景顏色一個十六進制值,我已經存儲在一個變量。我做了錯誤的事情,它給了我這個錯誤「未知顏色名稱'hex_value'」。我究竟做錯了什麼?TKinter - 如何在十六進制中使用變量來着色小部件?
hex_value = "#f35123"
root = Tk()
top_frame = Frame(root, bg="hex_value")
top_frame.pack(side=TOP, fill=X)
root.mainloop()
哦,上帝,我在想什麼? –