Getting the fill color or any other property of a item drawn in a canvas in tkinter(Python)
问题 I want to get the fill color or any other property of a item drawn in a canvas in tkinter. def createWidgets(self): self.canvas_1= tk.Canvas(self, bg='#FAFAFA',selectforeground='#BBDEFB'); i=self.canvas_1.create_rectangle((self.canvas_1.winfo_reqwidth()/2)+100, (self.canvas_1.winfo_reqheight()/2)+50, (self.canvas_1.winfo_reqwidth()/2)+150, (self.canvas_1.winfo_reqheight()/2)+100, fill='#FF4081',width=0) self.canvas_1.grid(); color= #want to access the fill color of item i using some getter