コードみたけど問題ないし、エラーも発生しない、という場合は権限見ると良いかもです

とりあえず下記の内容に従って

  • chrome
  • terminal
  • vscode

を全て許可することで実行ができました

Not a pyautogui user, but on Mojave, there’s a new security feature where you must explicitly allow applications to use your mouse/keyboard. Have a look in Security Preferences > Security & Privacy > Privacy > Accessibility – you might have to allow your terminal application in the list.

https://github.com/asweigart/pyautogui/issues/247

参考記事

https://github.com/asweigart/pyautogui/issues/247

コメントをどうぞ

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

CAPTCHA