这功能对于一些工业流程化的操作,或者稍加修改作为一个傻瓜式的按键脚本还是可以的,当然想要它智能一点也是完全没问题的,毕竟我Python大法优秀处理库很多,话不多说,code!
这里主要是用了pyautogui库实现的定位功能。
import os
import time
import pyautogui as pag
try:
while True:
print("Press Ctrl-C to end")
screenWidth, screenHeight = pag.size() #获取屏幕的尺寸
print(screenWidth,screenHeight)
ptx,pty = pag.position() #获取当前鼠标的位置
showStr = "Position:" + str(ptx).rjust(4)+','+str(pty).rjust(4)
print(showStr)

最低0.47元/天 解锁文章
2535

被折叠的 条评论
为什么被折叠?



