import time

import pyautogui


def print_location():
    while True:
        x, y = pyautogui.position()
        position_str = 'X: ' + str(x).rjust(4) + ' Y: ' + str(y).rjust(4)
        print(position_str, end='')
        time.sleep(0.1)
        print('\b' * len(position_str), end='', flush=True)
