I’m new to python and I’m trying to follow a tutorial on object detection, but my code calling find (which calls cv.matchTemplate) this error: import cv2 as cv import numpy as np from time import time from random import randint from windowcapture import WindowCapture from vision import Vision #points = get_click_points(‘img2.jpg’, ‘copper.jpg’, threshold=0.55, debug_mode=True) wincap ..
I do not know how to work with pywin32 and I get the error NameError: name ‘hWnd’ is not defined i was looking for the docs as well but couldn’t find it import win32gui import win32con from datetime import datetime win32gui.SetWindowPos(hWnd, win32con.HWND_TOPMOST, 0,0,0,0, win32con.SWP_NOMOVE | win32con.SWP_NOSIZE) # Code continues Source: Python..
This is the code. Comments are for sizes and the shapes RGB code. Might be an error with variables. I tried many times to fix but it did 0 changes. Note that I am a beginner. #Square RGB 255 232 105 #Pentagon 118 141 252 #Extreme screen top left 230 130 #Extreme screen bottom right ..
I am attempting to use win32com library to download outlook emails from a shared mailbox. My code is below: import win32com.client import win32com import pandas as pd from unidecode import unidecode import datetime outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI") folder = outlook.Folders.Item("My Shared Mailbox Name") inbox = folder.Folders.Item("Inbox") msg = inbox.Items subject =  body =  sender ..
SBAR Situation: I am trying to create a quick and efficient way for my Infection Preventionist Team to report our COVID-19 (and other Communicable Disease) cases to the Local Health Department. Background: Despite numerous/various iterations of the following code, I have been unable to make the mainfunc_init.py script [Titled: AutoPopulateOutlookEmail_Init.py] auto-populate an Outlook Email Template ..
I tried to make It clicks to random coordinates but it gave this error Exception has occurred: TypeError integer argument expected, got float code: import time import random import keyboard import win32api, win32con firstkey = input (‘def first key =’) cordinate = random.uniform(391, 904) cordinatetwo = random.uniform(158, 671) h = 0 def click(x,y): win32api.SetCursorPos((x,y)) win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,0,0) ..
I want to delete a row in excel sheet with win32com.client. I can delete columns, but cannot delete rows. The script I have tried and some error messages are: #1, failed example xl = win32.Dispatch("Excel.Application") ws=xl.Application.ActiveSheet ws.Rows(2).EntireRow.Delete() #error message: result = self._oleobj_.InvokeTypes(*(dispid, LCID, wFlags, retType, argTypes) + args) pywintypes.com_error: (-2147352567, ‘Exception occurred.’, (0, ‘Microsoft Excel’, ..
I’m working around with Python to make a simple UI automation script/macro that clicks on certain points on the screen. The script for clicking is already working, however the code is executed by manually pressing a button and I wish to change that, so that the execution of my script begins by it listening to ..
I’m using pywinauto for interacting with a window application. import pywinauto.findwindows as find from pywinauto import Application win = Application(backend = "uia").connect(handle = id)).windows() text_1 = (win.children(title = "Workspace")[-1] .children() .children(control_type = "Pane") .children(title="text_1") ) In the above code snippet, I’m trying to fetch text_1 from a window. When the number of children is less, ..
SBAR Situation: I am trying to create a quick and efficient way for my Infection Preventionist Team to report our COVID-19 (and other Communicable Disease) cases to the Local Health Department. Background: Despite numerous/various iterations of the following code, I have been unable to make the mainfunc_init.py script [Titled: HAI_QuickAlert_init.py] auto-populate an Outlook Email Template ..