5.Write a python program to get information about Display.
import subprocess
def get_display_info():
try:
xrandr_output = subprocess.check_output(['xrandr']).decode('utf-8')
# Print the output
print("Display information:")
print(xrandr_output)
except FileNotFoundError:
print("xrandr command not found. This program requires xrandr utility which is available on Linux systems.")
if __name__ == "__main__":
get_display_info()
Output 5:
Display information:
Screen 0: minimum 320 x 200, current 3520 x 1080, maximum 16384 x 16384
DVI-D-0 disconnected (normal left inverted right x axis y axis)
HDMI-A-0 connected primary 1920x1080+1600+0 (normal left inverted right x axis y axis) 476mm x 267mm
1920x1080 60.00*+ 50.00 59.94
1680x1050 59.88
1600x900 75.00 60.00
1280x1024 75.02 70.00 60.02