title: Pyautogui: Mouse Movement with bezier curve
body: <p>I'm trying to move the mouse in a bezier curve motion in Pyautogui to simulate more of a human movement as seen here:
  <a href="https://i.stack.imgur.com/URBev.gif" rel="noreferrer"><img src="https://i.stack.imgur.com/URBev.gif" alt="enter image description here"></a></p>
  
  <p>There is some tweening / easing functions within pyautogui but none of which represent a bezier curve type movement. I created a small script to calculate the random places it will hit before ultimately hitting its destination.</p>
  
  <p>Default "Robot" linear path:
  <a href="https://i.stack.imgur.com/OagRD.gif" rel="noreferrer"><img src="https://i.stack.imgur.com/OagRD.gif" alt="enter image description here"></a></p>
  
  <p>Unfortunately, which each destination the mouse temporarily stops.</p>
  
  <pre><code>import pyautogui
  import time
  import random
  print "Randomized Mouse Started."
  destx = 444;
  desty = 631;
  x, y = pyautogui.position() # Current Position
  moves = random.randint(2,4)
  pixelsx = destx-x
  pixelsy = desty-y
  if moves &gt;= 4:
          moves = random.randint(2,4)
  avgpixelsx = pixelsx/moves
  avgpixelsy = pixelsy/moves
  print "Pixels to be moved X: ", pixelsx," Y: ",pixelsy, "Number of mouse movements: ", moves, "Avg Move X: ", avgpixelsx, " Y: ", avgpixelsy
  
  while moves &gt; 0:
          offsetx = (avgpixelsx+random.randint(-8, random.randint(5,10)));
          offsety = (avgpixelsy+random.randint(-8, random.randint(5,10)));
          print x + offsetx, y + offsety, moves
          pyautogui.moveTo(x + offsetx, y + offsety, duration=0.2)
          moves = moves-1
          avgpixelsx = pixelsx / moves
          avgpixelsy = pixelsy / moves
  </code></pre>
  
  <p><strong>Info:</strong></p>
  
  <ul>
  <li>Windows 10</li>
  <li>Python 2.7</li>
  <li>Willing to use other libraries, Python version if necessary </li>
  </ul>
  
  <p>I've seen this post: <a href="https://stackoverflow.com/questions/22784341/python-random-mouse-movements">python random mouse movements</a></p>
  
  <p>but can't figure out how to define a "start and stop" position. The answer is pretty close to what I'm looking for.</p>
  
  <p>Any ideas on how to accomplish this?</p>