日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

python 窗体句柄_Python pyautogui窗口句柄(Python pyautogui window handle)

發布時間:2024/8/1 python 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python 窗体句柄_Python pyautogui窗口句柄(Python pyautogui window handle) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

Python pyautogui窗口句柄(Python pyautogui window handle)

使用pyautogui是否有辦法獲取窗口的句柄,以便我可以確保只在該窗口上執行單擊? 換句話說,如果我的窗口沒有聚焦,則不會發生單擊。 此外,如果我的窗口沒有聚焦,那么我將其置于焦點,然后執行操作。

是否有任何其他支持此類功能的Python模塊?

Using pyautogui is there a way to get a handle to a window so that I can ensure that a click is performed on that window only? In other words, if my window isn't in focus, then the click does not occur. Additionally, if my window isn't in focus then I bring it into focus and then perform the actions.

The way to identify a window could be an ID, window title etc similar to this https://autohotkey.com/docs/commands/WinGet.htm

Is there any other Python module that supports this kind of functionality?

原文:https://stackoverflow.com/questions/43785927

2019-12-06 07:36

相關問答

也許你沒有正確使用click功能。 查看函數定義: 單擊(x =無,y =無,clicks = 1,interval = 0.0,button ='left',duration = 0.0,tween =,pause = None,_pause = True) 使用pyautogui.click(650, 200, 10)你說x = 650,y = 200,點擊= 10。 我想你想說pyautogui.click(650, 200, interval=10) 。 The problem may h...

是否有任何其他支持此類功能的Python模塊? https://pywinauto.github.io https://pywinauto.readthedocs.io/en/latest/#some-similar-tools-for-comparison Is there any other Python module that supports this kind of functionality? https://pywinauto.github.io https://pywinauto....

這可能是因為你正在從Python 2.x shell中嘗試它。 請在python3 shell上試試這個命令并嘗試導入相同的命令。 It might be because you're trying it from a python 2.x shell. Instead try this command on a python3 shell and try importing the same.

看起來你需要導入ImageGrab from PIL import ImageGrab

Looks like you need to import ImageGrab from PIL import ImageGrab

我不確定SO上的格式設置是否正確(您的評論顯示為關鍵字),但看起來您的while True語句之外有if語句。 如果是這種情況,它將永遠不會被執行(或檢查)。 #! python3

import pyautogui

import time

pyautogui.screenshot('first.png')

check = pyautogui.locateCenterOnScreen('first.png')

print(check)

while True:

pyautogui.scree...

要安裝PyAutoGUI,請從PyPI和依賴項安裝pyautogui軟件包。 在Windows上,這是: C:Python34pip.exe install pyautogui

To install PyAutoGUI, install the pyautogui package from PyPI and dependencies. On Windows, this is: C:Python34pip.exe install pyautogui

Pyautogui的源代碼 def _sendMouseEvent(ev, x, y, dwData=0):

assert x != None and y != None, 'x and y cannot be set to None'

width, height = _size()

convertedX = 65536 * x // width + 1

convertedY = 65536 * y // height + 1

ctypes.windll.u...

你可以修補pyautogui內部。 測試'xvfb'后端。 import os

from pyvirtualdisplay import Display

import pyautogui

import Xlib.display

v_display = Display(visible=1, size=(1600,900))

v_display.start() # this changes the DISPLAY environment variable

# sadly, pyautogui do...

我得到這個錯誤,發現它仍然執行這個點擊: try:

pyautogui.click()

except:

print "Error-carrying on anyway"

或者,如果您不希望它打印任何東西: try:

pyautogui.click()

except:

pass

I got this error and found that it still performs the click- try this: try:

pyautogui.clic...

如果您需要可移植且可靠的解決方案,則必須找到支持輔助功能技術的庫,以便按文本訪問GUI元素。 基本技術是: Win32 API,MS UI自動化(Windows) AT-SPI(Linux) Apple Accessibility API(MacOS) 有幾個開源GUI自動化庫支持其中一些技術(通常為1或2)。 Python解決方案: Windows上的pywinauto (Win32 API和MS UIA,請參閱入門指南 ) Linux上的pyatspi2 MacOS上的pyatom Stack...

相關文章

當前屏幕分辨率為1280*1024,IE7下使用 window.open('', '', 'left

...

1、下載redis的window版本 下載地址: https://github.com/Service

...

Python 編程語言具有很高的靈活性,它支持多種編程方法,包括過程化的、面向對象的和函數式的。但最重

...

python2和python3的區別,1.性能 Py3.0運行 pystone benchmark的速

...

python的官網:http://www.python.org/ 有兩個版本,就像struts1和st

...

Python的文件類型 Python有三種文件類型,分別是源代碼文件、字節碼文件和優化代碼文件

源代

...

好久沒有寫了,還不是近期剛過的期末考試和期中考試 最近因為一個微信公眾平臺大賽在學phthon 找了本

...

總結

以上是生活随笔為你收集整理的python 窗体句柄_Python pyautogui窗口句柄(Python pyautogui window handle)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。