Category : pyautogui

I am trying to make a screen recording script with python. This is what I have so far: import cv2 import numpy as np import pyautogui import time img = pyautogui.screenshot() img = cv2.cvtColor(np.array(img), cv2.COLOR_RGB2BGR) fourcc = cv2.VideoWriter_fourcc(*’mp4v’) out = cv2.VideoWriter("video.mp4", fourcc, 60.0, (1680, 1050)) t1 = time.time() for i in range(0, 300): img = ..

Read more

I’m experiencing issues with the image recognition tool (pyautogui.locateOnScreen(‘/Users/kd/Desktop/image.png’, confidence=0.8) I have made a auto clicker script this is the part causing troubles. image = pyautogui.locateCenterOnScreen(‘/Users/kd/Desktop/image.png’, confidence=0.8) pyautogui.click(x=1180, y=160, clicks=1, interval=1, button=’left’) pyautogui.click(x=1125, y=105, clicks=1, interval=1, button=’left’) time.sleep(3) pyautogui.locateOnScreen(‘/Users/kd/Desktop/image.png’, confidence=0.8) print(image) if image is None: pyautogui.click(x=1415, y=105, clicks=1, interval=1, button=’left’) pyautogui.click(x=1165, y=390, clicks=1, interval=1, button=’left’) ..

Read more

I am using pyautogui on a RDP with Windows 10 and Python 3 loaded but when I run pyautogui with the RDP minimised, I receive the following error message: Traceback (most recent call last): File "C:/Users/Administrator/PycharmProjects/MyProject- Copy/main.py", line 40, in funks.post_video(title,filepath) File "C:UsersAdministratorPycharmProjectsMyProject- Copyfunks.py", line 10, in post_video pyautogui.click(1317, 56) File "C:UsersAdministratorPycharmProjectsTESTvenvlibsite-packagespyautogui_init_.py", line 585, in ..

Read more

I get this error when I write { with pyautogui. I need to press AltGr or altright + ‘ I get this error: pyautogui.press(‘altright’) X protocol error: <class ‘Xlib.error.BadValue’>: code = 2, resource_id = 0, sequence_number = 16,major_opcode = 132, minor_opcode = 2 X protocol error: <class ‘Xlib.error.BadValue’>: code = 2, resource_id = 0, sequence_number ..

Read more

OSError: screen grab failed Trying to run pyautogui on a virtual private server, but whenever I go off of RDP it gives me that error and stops the process of running my python program. Whats the solution for this? Source: Python..

Read more

I have the following code: import pyautogui as pg import time pg.moveTo(709, 1048) pg.leftClick() while pg.pixel(270, 231)[0] == 248: time.sleep(0.001) #while the pixel is a. certain color, the code should pause, # once the color changes, the code should continue break pg.moveTo(300, 300) print(‘if this prints it should work’) I am trying to make it ..

Read more