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.
1131 questions
-1
votes
1 answer

How to type @ using pyautogui

I am using pyautogui in python 2.7.x and I need to write the character "@". I've tried everything I know but I got no results. What code line/s should let me write the "@"?
-1
votes
1 answer

I am using pyautogui to detect the mouse position. I have a tkinter window, but the pyautogui only works when i close the tkinter window

I am creating a chinese Checkers Ai. I am trying to detect the mouse. I used pyautogui. from pyautogui import * while True: if position()[0] < 445 & position()[0] > 405: print("Mouse detected.") I also have a tkinter window, but lets…
F. Zeng
  • 55
  • 1
  • 11
-1
votes
1 answer

Do I need Threading Python Computer Vison

Do I need threading? I figured I could just write an entire separate python file and run concurrently but didn't seem very elegant. Example of Code while (True): cap screen process screen if standard deviation > Threasholdstd: …
-1
votes
1 answer

Python variable is not changing

I have a variable that should be changing that is named "scrolldown". It will not change from 0 but I dont know why. Here is my code. Any help is appreciated. For some reason, whenever python prints the variable "scrolldown" it is always 0 no matter…
Will
  • 41
  • 6
-1
votes
1 answer

Restricting the area that PyAutoGui's mouse feature will work

I want to make a program that randomly doodles on paint, but when I leave it alone for extended periods of time, it minimizes paint and moves every one of my files around is there any way to keep pyautogui from moving the mouse outside of a range?…
-1
votes
1 answer

How do I scrape text from a website using Selenium

How do I scrape text from a website using Selenium? I need to get an inner text from a website. I'm using the newest Python and Selenium, all up to date. I also have pyautogui. Here is what I need to scrape:
-1
votes
2 answers

Cannot install PyAutoGUI - receiving error

Can anyone help me on this? When I try to install PyAutoGUI, I am getting the following error: C:\Python 34>pip.exe install pyautogui Collecting pyautogui Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by…
Amal Jose
  • 15
  • 6
-1
votes
1 answer

Defining an infinite loop for Python Selenium, it currently needs improvement

My script serves as a web browser that is browsing the net according to the website provided on links.txt and the time interval stated. It should be available 24/7. Does anybody see any possible way to improve the code according to the goal of the…
R.DL
  • 3
  • 3
-2
votes
1 answer

How to run a specific function on a specific time in Python?

I am creating an automation script using pyautogui to click on a specific href text 'Start'. This text moves to the next section on the same page after 2 hours. Is there a module which can be used to tell the current time and if the time is in the…
-2
votes
2 answers

How do I create a bot to play games for me in python?

For the specific game I want to make a bot for (Fnaf: Ultimate Custom Night) I want to have certain keys pressed when something pops up on the screen. For this i need to recognize the object on the screen, and then use something like pyautogui to…
Trident
  • 11
  • 1
-2
votes
1 answer

Is there a function for checking if I'm pressing something on any screen on Python?

I have created a code for a game called Transformice. I want to use a function which checks if I'm pressing something ('esc' for example) inside the game and finishes the program. All functions that I read about needed me to press the letter on the…
Hockpond
  • 1
  • 1
-2
votes
1 answer

Supervised Machine Learning Prediction to pyautogui

I'm a newbie to Machine Learning. I'm making a smart glove to recognise different hand gesture using KNN classifier. So far I've successfully typed out the code and been able to predict the correct gesture that I input. Now, I want to use the…
-3
votes
1 answer

Python- How that should be loop which repeat the code?

Hi I'm working on an Instagram bot, I want to put this part of the code into a constantly repeating loop. driver.find_element_by_xpath("/html/body/div[5]/div[1]/div/div/a")\ .click() pyautogui.click(x=1063,y=748) sleep(3) pyautogui.click(x=1154,…
JustBatu
  • 1
  • 2
-3
votes
1 answer

PyAutoGui Nan NaN NaN

pyautogui.displayMousePosition() displays 848 Y: 853 RGB: (NaN, NaN, NaN) I am not sure why it will not pick up RGB colors. thanks
-3
votes
1 answer

how to overcome from this "'module' object is not callable"

File "C:/Users/kanha/PycharmProjects/automatic_game/bot.py", line 25, in imagegrab() File "C:/Users/kanha/PycharmProjects/automatic_game/bot.py", line 20, in imagegrab image = ImageGrab(box) TypeError: 'module' object is not…
1 2 3
75
76