Get list of open windows in Python

て烟熏妆下的殇ゞ 提交于 2019-11-30 16:26:48
Peter Hansen

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.

try using dragonfly. It has a whole lot of automation stuff built into it. You don't need the speech recognition part in order to use the automation stuff. For example:

from dragonfly import Window
Window.get_all_windows()

will return a list of all the windows.

you also want to look at the FocusWindow() and Keys() objects in dragonfly.

Alvin Row

Even if you need to use automation for everything else your app is going to do, it would probably be a lot easier to use the webbrowser module for opening urls in the user's browser.

I like PyAutoGUI. You can see their docs here. I've typed with it before

From the docs:

import pyautogui

pyautogui.typewrite('Hello world!', interval=0.25)  # type with quarter-second pause in between each key
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!