Do you know that you can operate the mouse and keyboard automatically? With pyautogui, you can easily operate the mouse and keyboard.
moveTo The moveTo function is a function for moving the mouse pointer.
sample.py
pyautogui.moveTo(x coordinate,y coordinate)
click The click function is a function to click a specific position on the PC screen.
sample.py
pyautogui.click(x coordinate,y coordinate)
rightClick The rightClick function is a function to right-click a specific position on the PC.
sample.py
pyautogui.rightClick(x coordinate,y coordinate)
position The position function is a function to get the current mouse position.
sample.py
place=pyautogui.position()
print("x coordinate", place.x)
print("y coordinate", place.y)
typewrite The typewrite function is a function that inputs the passed character string character by character.
sample.py
pyautogui.typewrite("hello")
hotkey The hotkey function is a function for entering keys such as the Enter key (Return key) and the Alt key.
sample.py
pyautogui.hotkey("Return")
pyautogui.hotkey("Alt")
Have you become proficient in pyautogui? I hope so. I will continue to write many articles about Python. If you read this article and have any thoughts, please let us know in the comments.
Recommended Posts