title: Trying to create a mouse recorder, but it keeps looping endlessly?
body: <p>I'm trying my hand at Pynput, and I'm starting off with creating a simple program to record the movements of a mouse, and then replay those movements once a button is clicked. </p>
  
  <p>However, every time I click the mouse, it just starts to freak out and endlessly loop. I think it's going through the movements at a super high speed, but I eventually have to Alt-F4 the shell to stop it. </p>
  
  <p>Any help would be appreciated. </p>
  
  <pre><code>import pynput
  
  arr = []
  
  from pynput import mouse
  
  mou = pynput.mouse.Controller()
  
  def on_move(x,y):
      Pos = mou.position
      arr.append(Pos)
  
  def on_click(x, y, button, pressed):
      listener.stop()
      for i in arr:
          mou.position = i
      print("Done")
  
  listener = mouse.Listener(on_move = on_move, on_click=on_click)
  listener.start()
  </code></pre>