So I have this code which draws a simple rectangle:
from tkinter import * root = Tk() canvas = Canvas(root, width = 500, height = 500) canvas.pack() canvas
Name it and then refer to it through itemconfig, like this:
itemconfig
myrectangle = canvas.create_rectangle(100, 100, 400, 400, fill='black') canvas.itemconfig(myrectangle, fill='red')