インストール方法 インストール方法は pip を使って行うのが手っ取り早くて便利です。 pip install pyautogui 残念ながら pip でインストールするだけでは Windows では画像処理系がちゃんと動かない様子。 IOError: decoder zip not available pngファイルを扱おうとすると上記エラーが頻発します。 そのため、PILというライブラリをインストールしましょう。 pip install Pillow 使い方 指定画像をクリック import pyautogui image_path = "#set your image file path here" location = pyautogui.locateOnScreen(image_path) buttonx, buttony = pyautogui.center(location)
![Pythonで簡単自動化!PyAutoGuiが便利すぎて感動したのでご紹介](https://cdn-ak-scissors.b.st-hatena.com/image/square/6589e45f920797b4f91fb3fd00b42a05445baffe/height=288;version=1;width=512/https%3A%2F%2Ffx-kirin.com%2Fwp-content%2Fuploads%2F2015%2F02%2F4981810037_f92989c61a_z.jpg)