title: Why is my code only printing x and y once?
body: <p>I am trying to be able to move the turtle to my mouse click than print x and y.</p>
  <pre><code>
  import turtle
  
  tim = turtle.Turtle()
  tim.shape('turtle')
  screen = tim.getscreen()
  
  def getPos():
  # this should move turtle to mouse click and print coords
      screen.onscreenclick(tim.goto)
      print(tim.xcor(), tim.ycor())
  
  def main():
  # once I run, it prints coords but once I move turtle it does not
      getPos()
      screen.mainloop()
      turtle.bye()
      
  main()
  </code></pre>
  <p>Once I run my program, it prints x and y. However, once I move the turtle with a mouse click, it does not print the coordinates.</p>