获取 Python 中打开的窗口列表 [英] Get list of open windows in Python

查看:20
本文介绍了获取 Python 中打开的窗口列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用 Python 编写一个应用程序,该应用程序必须能够向另一个应用程序发送密钥或文本.例如,如果我打开了 Firefox,我应该可以向它发送一个 URL 来打开它.

I am writing an app in Python that must be able to send keys or text to another app. For example, if I have Firefox open, I should be able to send it an URL to open it.

我已经有了 SendKeys 模块,我也读过 win32 模块,但我不知道有没有办法在不打开窗口的情况下过滤掉进程.

I already have the SendKeys module, and I have read about the win32 module too, but I do not know if there is a way to filter out process without open windows.

推荐答案

通常,对于这种GUI 自动化"pyWinAuto 是一个不错的选择.我们使用它来允许对 GUI 应用程序进行自动化测试,它也应该让您在 Firefox 中键入"URL(更不用说找到它的窗口了).

Usually, for this sort of "GUI automation" pyWinAuto is a good way to go. We use it to allow automated testing of GUI applications, and it ought to let you "type" URLs into Firefox (not to mention finding its window) as well.

这篇关于获取 Python 中打开的窗口列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆