pyautogui and pyperclip automatically enter Chinese

pyautogui function

(Instead of the keyboard and mouse operation automatically setting, super fun>. <)

 

the moveTo (x, y) move the mouse to the specified x, y coordinates (the upper left corner of the screen as the origin (0,0), y increases downward, increasing to the right x)

moveTo (x, y, duration) used after a few seconds duration values ​​provided to move the mouse to the specified x, y coordinates

moveRel (x, y) relative to the current mouse position of the mouse.

size () to get the screen width and height values

position () to get the current mouse position

locateOnScreen ( '* .png') on the screen to find the image of the same position by image recognition, and returns the coordinates size

center (size) coordinate of the object image can be obtained by locateOnScreen, and returns its center point coordinates on the image (the moveTo available, move to here)

dragTo (x, y) pressing the left mouse movement.

dragRel (x, y) pressing the left, relative to the current mouse position.

click (x, y, button) to simulate a click (the default is left).

rightClick () Simulates a right click.

middleClick () simulate button clicks.

doubleClick () simulation double left click.

mouseDown (x, y, button) simulate the x, y specifies the mouse button is pressed.

mouseUp (x, y, button) simulate the x, y released at the specified key.

scroll (units) analog scroll wheel. N represents a parameter scroll up, scroll down parameter indicates negative.

typewrite (message) message type given character string.

typewrite ([key1, key2]) given key type string, only English.

press (key) to press and release a given key.

keyDown (key) simulate pressing a given key is not released.

keyUp (key) Analog release a given key.

Hotkey ([key1, key2]) simulated by pressing a given key sequence strings, then in reverse order release, (copy and paste operations to achieve)

pyautogui.PAUSE = 1 to pyautogui.PAUSE set to 1, i.e. second pause after each function call.

pyautogui.FAILSAFE = True starts failsafe function can

 

pyperclip function

(Can be automatically input Chinese by this library function)

 

 copy ( 'str1') to copy the contents of str1, and other content may be set to Chinese

 paste () to copy and paste the contents of input can also be used in paste hotkey implemented pyautogui

 

pip install two libraries

python pip.exe install pyautogui

python pip.exe install pyperclip

 

 

 

 



Guess you like

Origin www.cnblogs.com/zwc--blog/p/11079986.html