title: Python canvas colour change by button
body: <p>I am a python self learner. I was stuck on some practice.
  My idea was to create a pop out GUI with buttons that can change the canvas colour.</p>
  
  <pre><code>from Tkinter import *
  import ttk
  import tkMessageBox
  
  root = Tk()
  root.title("Colour!")
  
  canvasColor = "yellow"
  
  def buttonRed() :
      canvas = Canvas(root, bg = "red", height=100, width=100) 
      canvas.grid(row=0,column=2)
  
  button = ttk.Button(root, text="Red", command = buttonRed)
  button.grid(row=2,column=1)
  
  button2 = ttk.Button(root, text ="Green", command = buttonGreen) 
  button2.grid(row=2,column=2)
  
  button3 = ttk.Button(root, text="Blue", command = buttonBlue)
  button3.grid(row=2,column=3)
  
  canvas = Canvas(root, bg = canvasColor, height=200, width=200) 
  canvas.grid(row=0,column=2)
  
  
  root.configure(background='white')
  root.mainloop()
  </code></pre>
  
  <p>i haven't put in the green and blue button command yet, but instead of creating a new canvas when the colour button clicked, i just wanted to have the default canvas colour change.</p>
  
  <p>Any help will be much appreciated!
  Thanks in advance.</p>