Tkinter Canvas / Drawing

Documentation for Tkinter Canvas:
http://effbot.org/tkinterbook/canvas.htm

This example creates a canvas called and draws a few shapes on it.

from Tkinter import *

root = Tk()

c = Canvas(root, width=300, height=300)
c.grid(row=0,column=0)

#These will become items 1, 2, 3
c.create_line(0, 100, 200, 0, fill='blue')
c.create_oval(200,200,300,300, outline='#000000', fill='#ff0000')
c.create_rectangle(20,150,50,250, fill='#0000ff')

#move item 2 to a new set of coords
c.coords(2, (100,100,200,120) )

#change an attribute of item 3
c.itemconfig(3, fill='#00ff00')

mainloop()

Each shape is assigned a number when you create it. In the above example, the first shape created (the line) is number 1, the oval is number 2, and the rectangle is number 3.

To change a shape after it is drawn, you can refer to its number using the coords() and itemconfig() functions as shown in the example above.

You can use a function connected to a widget to let the user change the position and attributes of the shapes.