Consider:
from Tkinter import *
a = Tk()
canvas = Canvas(a, width = 500, height = 500)
canvas.pack()
canvas.create_rectangle(0, 0, 100, 100)
Assign the create_rectangle()
to a variable, and then call canvas.delete() on that variable:
from Tkinter import *
a = Tk()
canvas = Canvas(a, width = 500, height = 500)
canvas.pack()
myrect = canvas.create_rectangle(0,0,100,100)
canvas.delete(myrect) #Deletes the rectangle
Window before deletion:
Window after deletion: