Q:

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 functions.

A:

you can do this using the itemcget method:
effbot 
so you could use:
color = self.canvas_1.itemcget(i, "fill")

