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
1 answer

How do I add a number to avariable every set line of code?

I have a line of code with a number. The code is copypasted multiple times so it can run many times. The problem is the numbers don't change. I am using pyautogui so the following is an example. import…
0
votes
0 answers

Is pyautogui work in the ubuntu 18.04 server version with no display accessed via ssh?

When I am import pyautogui it gives me: Traceback (most recent call last): File "app.py", line 2, in from register import reg File "/home/nlp/Projects/face_recognition/register.py", line 12, in import pyautogui File…
0
votes
1 answer

How to install pyautogui?

Hi i'm currently tring to install pyautogui with pip but i get this error: ERROR: Command errored out with exit status 1: command: 'c:\users\elève\appdata\local\programs\python\python38-32\python.exe'…
0
votes
1 answer

i got a windows error and os error while making a pyautogui program

when i ran the code below i got this error: File "e:\pranil\python\doing shit with python\automating dino game.py", line 12, in if auto.pixelMatchesColor(i,j, (83, 83, 83)): File…
user9387061
0
votes
1 answer

Compare pixel X with pixel Y until pixel Y changes, then do... Any tips on how to reduce lag?

I am using a infinite loop constantly scanning a X,Y place at my screen waiting for the color to change (I need it to be as fast as possible, as soon as the color changes), then send a key press but this is making my computer lag a lot, any tips on…
0
votes
2 answers

AttributeError: module 'pyautogui' has no attribute 'write'

I Made a Simple Program using pyautogui: import pyautogui pyautogui.write('Hello world!') But when I run it I get this Error: Traceback (most recent call last): File "C:/Users/*****/Miscellaneous/Python projects/simple_pyautogui_program.py", line…
Bento Bean
  • 1
  • 1
  • 1
0
votes
2 answers

Pyautogui image recognition returns None no matter what I do

I have been trying to get pyautogui to locate graphically a folder on my desktop but it fails no matter what I do: This is my code (int_auto.py) import pyautogui button =…
Cadell Teng
  • 224
  • 3
  • 23
0
votes
1 answer

Incrementing A Value In a Function

So I have this function that drives to a website and clicks a bunch of stuff. I would like the y variable to increment by +20 every time the loop completes. The y value is in the last set of coordinates for the autogui clicks at the end. I think…
Digital Moniker
  • 281
  • 1
  • 12
0
votes
1 answer

PyAutoGui Module is not running (Yes it is installed)

I recently installed Pyautogui, and yet it is not working. Import pyautogui is working, and the commands that do not involve moving the mouse is working (e.g, getting the length and width of the screen). However, when I tried to do, for…
Viv
  • 9
  • 3
0
votes
1 answer

Exception in thread thread-2 , TypeError: clickc() argument after * must be an iterable, not bool

I am trying to make an auto clicker controlled with keyboard . And I get Exception in thread thread-2 indeed I get TypeError: clickc() argument after * must be an iterable, not bool import keyboard, pyautogui as pag import time import…
Cloaaker
  • 60
  • 9
0
votes
2 answers

PyAutoGUI from Windows subsystem linux

how can I execute mouse clicks in windows from Python code that is running in WSL? I tried using PyAutoGUI, however, I get the following error: ... File "/usr/lib/python3.6/os.py", line 669, in __getitem__ raise KeyError(key) from None KeyError:…
Robert J Axe
  • 23
  • 1
  • 4
0
votes
1 answer

Want to get a grip of this pyautogui command

Well, I pretty much just copied this code that gets the x and y position of the cursor, and 'I'd like to ask what each line of command does so I can get a grip of it. Thanks in advance ! print('Type Ctrl-C to stop the program') try: while…
cvcvka5
  • 57
  • 1
  • 7
0
votes
0 answers

windows 10 pyautogui multiple desktops

I made an automation with pyautogui. Windows 10 has multiple desktops feature. Can I run my automation in a desktop and use some other desktop at the same time?
canbax
  • 3,432
  • 1
  • 27
  • 44
0
votes
2 answers

How to focus on a window with python?

I'm writing a python code that allows a user to mark text from a website and then paste it into a word document. I'm using pyautogui and win32clipboard. So here is the flow- 1. the user finds an interesting line on a website. 2. the user marks the…
KarinP
  • 101
  • 1
  • 7
0
votes
0 answers

Python - Multiple Clicks at different location on screen at the same time

I have this idea but I don't even know where to start haha Basically, Lets say I want to click these 2 locations (50, 100) and (1000, 500) I could just click them 1 by 1 like this import…
SunAwtCanvas
  • 1,261
  • 1
  • 13
  • 38
1 2 3
99
100