import pyautogui
import keyboard
key = "/"
end = "-"
run = 1
while run:
file = open("file.txt","a")
a = pyautogui.position()
if keyboard.is_pressed(key):
a = str(a)
print(a)
file.write(a)
file.write("\n")
if keyboard.is_pressed(end):
file.close()
run = 0