Questions tagged [pyautogui]

PyAutoGUI is a cross-platform GUI automation Python module used to programmatically control the mouse and keyboard.

Official document.

PyAutoGUI lets your Python scripts control the mouse and keyboard to automate interactions with other applications. The API is designed to be as simple. PyAutoGUI works on Windows, macOS, and Linux, and runs on Python 2 and 3.

PyAutoGUI has several features:

  • Moving the mouse and clicking or typing in the windows of other applications.
  • Sending keystrokes to applications (for example, to fill out forms).
  • Take screenshots, and given an image (for example, of a button or checkbox), find it on the screen.
  • Locate an application’s window, and move, resize, maximize, minimize, or close it (Windows-only, currently) Display message boxes for user interaction while your GUI automation script runs.
1828 questions
0
votes
0 answers

Automation of Twinfield add in execution in Excel preferably using Python libraries

I have been trying to automate the process of executing the "Twinfield Analysis" add-in in Excel for quite some time. The challenge I face is that this add-in is needed to be clicked and login details need to be entered every time I reopen the excel…
0
votes
1 answer

Cannot get keyboard key from variable

So I'm trying to make a program that can hold/autoclick keyboard keys. The problem is, the program doesn't understand the key to press from the variable (obtained from Tkinter Entry) I give it. When I use pynput to press the key, it says that I…
MaLoLHDX
  • 3
  • 4
0
votes
0 answers

turning on monitor by python code from sleep mode

Do you have any idea of how to turn on monitor by python code from power saving mode in window 10? I tried.. change settings regarding power saving mode task scheduler (also checked the option that terminates sleep mode to execute the task) wake up…
BBiYak
  • 29
  • 5
0
votes
0 answers

PyAutoGUI ignores colors when locating images

When using pyautogui.locateAllOnScreen() to look for images on screen (2x2 black pixels), the function returns coordinates of every single 2x2 matching pixels on screen, completely ignoring their color. Same thing happens with locateOnScreen(), it…
ragequit
  • 3
  • 5
0
votes
1 answer

Pyautogui automation - Identify waiting time issue

I am trying to automate a task with pyautogui. After a click program starts loading for few second and this time varies every time. Th script has to wait for that time to perform next operation/click. I was thinking to take the screenshot but in…
Lovepreet Singh
  • 321
  • 1
  • 7
  • 16
0
votes
0 answers

How to use pyautogui over vps?

I am currently struggling to get pyautogui to work with my vps. The script runs fine locally, but when I attempt to launch the command on another computer outside of the network, I am getting the "screen grab failed" error. I think this may be due…
0
votes
1 answer

PyAutoGui Confirm window change location

I would like to change the location of the PyAutoGui confirm window that pops up. How can I do this? import pyautogui pyautogui.confirm(text='title', title='title', buttons=['1', '2'])
Branden
  • 326
  • 1
  • 3
  • 14
0
votes
2 answers

How to automate fast mouse drag in Python?

I've tried to automate mouse drag with pyautogui by launching this code: pyautogui.dragTo(1900, 500, 0.1, button='left') But instead of performing it with 0.1 seconds it takes much longer. How to automate mouse drag with high velocity? Maybe fix…
Daniil Kunin
  • 143
  • 1
  • 12
0
votes
0 answers

ModuleNotFoundError while creating exe file from pyinstaller

I am trying to generate the .exe file from the python script that I have written. I am running pyinstaller --onefile script_name.py in Acacnonda Promp (while being in the folder with the script itself) and it runs with no errors. However, when I am…
akkab
  • 401
  • 1
  • 6
  • 19
0
votes
2 answers

Pyautogui For Loop Skips

i'm having an issue looping through a list of items and using the pyautogui.write function to input in items from each iterated items in a text box,basically what happens is that the loop skips sometimes two items or three items, here is my code The…
0
votes
2 answers

Printing Pyautogui Command in pygame

I am currently trying to make a pyautogui/pygame code that tracks the mouse location and prints the cords on a pygame window. Here is what I have so far: import pygame import pygame.freetype import pyautogui import time pygame.init() POS =…
Triobro3
  • 21
  • 3
0
votes
1 answer

I Can't Install PyAutoGu

MacOs 10.14.6 Python3.7 I've been trying to install pyautogui for days now and I always get the same error. I've tryed a lot of solutions i found online but none of them seem to work! This is the message I get everytime no matter what. ERROR:…
Mattt
  • 1
0
votes
1 answer

Wait for image to disappear by using pyautogui

In using pyautogui to check if an image is not part of the screen, I tried below: a = True while a is True: a = pyautogui.locateOnScreen('image.png') print ("No this image.') It doesn't seem work well. What's the proper way to do so? Thank you.
Mark K
  • 8,767
  • 14
  • 58
  • 118
0
votes
0 answers

Python play sound if pixel on screen

I'm trying to make a script using the winsound, keyboard, and pyautogui modules. I want it to play when a pixel at the dedicated coordinates on screen is white and when the quit key (q) isn't pressed. Here is what I've tried while…
Mitchell
  • 27
  • 4
0
votes
2 answers

EOFError: Ran out of input and file im trying to pickle is not empty

import pyautogui import pickle username = input("Enter your steam username: ") pickle_out = open("steam.pickle","wb") pickle.dump(username, pickle_out) pickle_out.close password_input = input("Enter your password: ") password_test = input("Enter…
IskandarG
  • 1
  • 1
  • 3
1 2 3
99
100