pyautogui

Python code to close all open application in windows

Python code to close all open application in windows Question: I am working on pyautogui for locateonscreen but I need to make sure I have a clean windows prior to running it. I need help with a code that will kill/close all open/active windows application and then open a single exe using subprocess. Asked By: …

Total answers: 2

Python Script Failing to Open Firefox.lnk file on Desktop Path

Python Script Failing to Open Firefox.lnk file on Desktop Path Question: TLDR; I have a python script that uses autopygui to click on a file and open it, but it does not work with lnk files located in the same path. I have a little script using pyautogui to screenshot a desktop icon and save …

Total answers: 2

pygetwindow Error, AttributeError: 'list' object has no attribute 'topleft'

pygetwindow Error, AttributeError: 'list' object has no attribute 'topleft' Question: I am trying to get a screenshot of a specific window, but I get the following Error: AttributeError: ‘list’ object has no attribute ‘topleft’. How can I solve it ? import pygetwindow import pyautogui from PIL import Image import platform path = ‘report/result.png’ titles = …

Total answers: 2

Pyautogui taking screenshot of a region like sharex does

Pyautogui taking screenshot of a region like sharex does Question: I am trying to make a program using pyautogui to screenshot a part of my screen. Everything is working as I intend it to, except when I click on the screenshot button, the only way I found to make it possible for me to choose …

Total answers: 1

How to get an item in a list based on a number in Python?

How to get an item in a list based on a number in Python? Question: I am trying to code something in Python that makes the user type random phrases. If you manage to find out how to do this, I would appreciate it. import pyautogui import random phrases = ["Phrase1", "Phrase2", "Phrase3"] while True: …

Total answers: 1

How to make KeyboardInterrupt outside of console?

How to make KeyboardInterrupt outside of console? Question: I’m using PyAutoGui for automation of adding data to certain fullscreen app. Problem is, when I try to Alt+Tab back to my IDE it constantly brings app back to front and messes up my code by pasting data there. I need a way to either prevent script …

Total answers: 1

Failing to install pyautogui on windows in vscode

Failing to install pyautogui on windows in vscode Question: I don’t know what is wrong with my PC. When I run python in IDLE, I am able to access it, however, when I move to vs-code, all hell breaks loose. This is the error I am getting when I try to install it File "C:Program …

Total answers: 1

import pyautogui does not work in VSCode, despite having everything installed

import pyautogui does not work in VSCode, despite having everything installed Question: Im learning Python at the moment and I am trying to work with pyautogui at the moment but I have encountered a very basic problem and while I found other questions like this, I did not find a solution. My "Setup": I am …

Total answers: 1

pyautogui throws me error message. How can I fix my code?

pyautogui throws me error message. How can I fix my code? Question: It gives me error message like below. How can I fix this? Traceback (most recent call last): File "c:UsersjayjeotempCodeRunnerFile.py", line 3, in <module> x, y = pyautogui.locateCenterOnScreen(‘yellow.png’, confidence=0.8) TypeError: cannot unpack non-iterable NoneType object I made a code as below. I think that …

Total answers: 1

In python, can locateCenterOnScreen be used with region?

In python, can locateCenterOnScreen be used with region? Question: There is a large picture including number 8. First, I want to detect the large picture as below: left, top, width, height = pyautogui.locateOnScreen(‘original.png’, confidence=0.3) Second, if the large picture is detected, then I want to narrow down to find the number 8. x, y = …

Total answers: 1