Python Forum

Full Version: Display device details i.e connected with more than one device
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How to get display device details , where the system is connects with more than one display devices like DP, MDP , SDP ,HDMI ..etc
What OS do you use? What kind of details?
While I don't know what are the exact details/properties you are looking for, a quick search gave me these results which may help you:

Screen resolution:
http://stackoverflow.com/questions/31293...-in-python

Refresh rate, colour, bits per pixel:
http://stackoverflow.com/questions/12250...fresh-rate
OS : window
Python 2.7

Looking for device name

Python program that automatically finds and identifies multiple display devices connected to my computer (Windows)
See thisĀ on SO.
Also, I don't if it's there but it is, you may try to take that info from the registry.
I have tried below code

import subprocess
import re

proc = subprocess.Popen(['powershell', 'Get-WmiObject win32_desktopmonitor;'], stdout=subprocess.PIPE)
res = proc.communicate()
monitors = re.findall('(?s)\r\nName\s+:\s(.*?)\r\n', res[0].decode("utf-8"))
print(monitors)
But getting only one display device detail.Actually system is connected to EDP and VGA.

Moderator Larz60+: Removed formatting and added python tags -- please remember these
import wmi
obj = wmi.WMI().Win32_PnPEntity(ConfigManagerErrorCode=0)
print obj

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