1

我正在尝试使用 Python 获取任意窗口的 X 窗口 ID。

理想情况下,脚本将采用与从 shell 运行相同的形式xwininfo- 允许用户单击窗口并确定所选窗口的 XID。

我查看了xwininfo.c(link here ) 的来源,但我找不到任何可用于 python 的库来完成相同的工作。

任何帮助将非常感激 :)

4

1 回答 1

0

If I was trying to do this I would just use subprocess or sh to run xwininfo from the shell and then grab its output and do whatever you need with it. Is there a reason you want to emulate its behavior rather than just using it?

于 2012-12-09T00:19:00.747 回答