pyautogui doesn't let me select text

此生再无相见时 提交于 2019-12-04 15:29:22

I found the answer! Finally!
It wasn't selecting text for me as long as NUM LOCK was enabled. (I don't know why).

After disabling NUM LOCK it started selecting text again!

You do not use click twice. Here is an example on how to do it from the documentation:

pyautogui.doubleClick()

PS: I tkink you wanted to do left click...

Just found out about 'hotkey' function. Appears to be faster than the single key variation as well.

Example for a copy text and paste per line macro:

import pyautogui as pyg

def macro():

    pyg.press('home')
    pyg.hotkey('shiftleft', 'end')
    pyg.hotkey('ctrl', 'c')
    pyg.press('end')
    pyg.press('enter')
    pyg.hotkey('ctrl', 'v')
    pyg.press('down')

i = macro()

# Do macro 10 times
for i in range(10):
    macro()
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!