now that you understand screen coordinateslet' move the mouse the pyautogui moveto(function will instantly move the mouse cursor to specified position on the screen integer values for the xand -coordinates make up the function' first and second argumentsrespectively an optional duration integer or float keyword argument specifies the number of seconds it should take to move the mouse to the destination if you leave it outthe default is for instantaneous movement (all of the duration keyword arguments in pyautogui functions are optional enter the following into the interactive shellimport pyautogui for in range( )move mouse in square pyautogui moveto( duration= pyautogui moveto( duration= pyautogui moveto( duration= pyautogui moveto( duration= this example moves the mouse cursor clockwise in square pattern among the four coordinates provided total of times each movement takes quarter of secondas specified by the duration= keyword argument if you hadn' passed third argument to any of the pyautogui moveto(callsthe mouse cursor would have instantly teleported from point to point the pyautogui move(function moves the mouse cursor relative to its current position the following example moves the mouse in the same square patternexcept it begins the square from wherever the mouse happens to be on the screen when the code starts runningimport pyautogui for in range( )pyautogui move( duration= pyautogui move( duration= pyautogui move(- duration= pyautogui move( - duration= right down left up the pyautogui move(function also takes three argumentshow many pixels to move horizontally to the righthow many pixels to move vertically downwardand (optionallyhow long it should take to complete the movement negative integer for the first or second argument will cause the mouse to move left or upwardrespectively getting the mouse position you can determine the mouse' current position by calling the pyautogui position(functionwhich will return point named tuple of the mouse cursor' and positions at the time of the function call enter the following into the interactive shellmoving the mouse around after each callpyautogui position(get current mouse position point( = = controlling the keyboard and mouse with gui automation