title: Drawing a Shape Using a Button (Python Tkinter)
body: <p>Is it possible to bind a button to a function that draws a shape on the canvas? </p>
  
  <p>I have this section of code:</p>
  
  <pre><code>def option(*args):
  global missguess
  missguess=missguess+1
  if missguess==1:
      w.create_oval(210,100,295,175,width=3)
  if missguess==2:
      w.create_line(249,175,249,285,width=3)
  if missguess==3:
      w.create_line(249,200,270,250,width=3)
  if missguess==4:
      w.create_line(249,200,228,250,width=3)
  if missguess==5:
      w.create_line(249,285,228,350,width=3)
  if missguess==6:
      w.create_line(249,285,270,350,width=3)
      print("You Lose!")
  </code></pre>
  
  <p>And this option function is bound to a number of buttons. I keep getting the error:</p>
  
  <pre><code>AttributeError: 'Button' object has no attribute 'create_oval'
  </code></pre>
  
  <p>I have tried to make functions inside the option function that draws the shapes like this:</p>
  
  <pre><code>def option(*args):
  global missguess
  missguess=missguess+1
  if missguess==1:
     def oval():
        w.create_oval(210,100,295,175,width=3)
  </code></pre>
  
  <p>but then nothing shows up on the canvas. I'm not sure if there is even a way to do this.</p>