import json
import os
import time
import urllib
import pyperclip
import pyautogui
import pyautogui as pag
from easygui import msgbox as g
from keyboard import wait as w
img = cv2.cvtColor(np.asarray(img), cv2.COLOR_RGB2BGR)
a = 1
box = []
while a:
try:
w(‘shift’)
print(“Press Ctrl-C to end”)
x, y = pag.position() # 返回鼠标的坐标
print(x, y)
box.append(x)
box.append(y)
posStr = “Position:” + str(x).rjust(4) + ‘,’ + str(y).rjust(4)
print(posStr) # 打印坐标
time.sleep(0.2)
os.system(‘cls’) # 清楚屏幕
a = 0
w(‘shift’)
print(“Press Ctrl-C to end”)
x, y = pag.position() # 返回鼠标的坐标
print(x, y)
x -= box[0]
y -= box[1]
box.append(x)
box.append(y)
posStr = “Position:” + str(x).rjust(4) +