text: import pyautogui
  
  pyautogui.FAIL_SAFE = True
  pyautogui.PAUSE = 1
  
  print("press Ctrl + C to quit ! ")
  
  try:
      while True:
  
          x , y = pyautogui.position()
          positionStr = 'X : ' + str(x).rjust(4) + ' Y : ' + str(y).rjust(4)
  
          print(positionStr, end='')
          print('\b' * len(positionStr), end='', flush=True)
  
  except KeyboardInterrupt:
  
      print("Done.")