gpt4 book ai didi

python - 使用 Python 获取事件窗口

转载 作者:IT老高 更新时间:2023-10-28 20:53:13 27 4
gpt4 key购买 nike

我想使用 python 在屏幕上获取事件窗口。

比如你输入用户名密码的路由器的管理界面为admin

那个管理界面是我想用python来自动输入用户名和密码的。

我需要什么进 Eloquent 能做到这一点?

最佳答案

在 windows 上,您可以使用 python 进行 windows 扩展(http://sourceforge.net/projects/pywin32/):

from win32gui import GetWindowText, GetForegroundWindow
print GetWindowText(GetForegroundWindow())

以下代码适用于 python 3:

from win32gui import GetWindowText, GetForegroundWindow
print(GetWindowText(GetForegroundWindow()))

(在 http://scott.sherrillmix.com/blog/programmer/active-window-logger/ 上找到这个)

关于python - 使用 Python 获取事件窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10266281/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com