简体   繁体   English

使用Python查找和识别多个显示设备(监视器)

[英]Find and identify multiple display devices (monitors) using Python

I would like to write a Python program that automatically finds and identifies multiple display devices connected to my computer (Windows). 我想编写一个Python程序,自动查找并识别连接到我的计算机的多个显示设备(Windows)。 Further I would also like to programmatically start a display session (for example a slide show) in one of those devices. 此外,我还想以编程方式在其中一个设备中启动显示会话(例如幻灯片放映)。 Any ideas how this can be done? 有什么想法可以做到这一点?

Thank you, 谢谢,

Indranil. Indranil。

Here are links to some related questions (not the exact question): 以下是一些相关问题的链接(不是确切的问题):

  1. How do I get monitor resolution in Python? 如何在Python中获得显示器分辨率?

  2. How to query NATIVE hardware resolution of primary monitor in Windows? 如何在Windows中查询主监视器的NATIVE硬件解析?

import wmi
obj = wmi.WMI().Win32_PnPEntity(ConfigManagerErrorCode=0)

displays = [x for x in obj if 'DISPLAY' in str(x)]

for item in displays:
   print item

It gives all connected monitor details. 它提供所有连接的监视器详细信

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM