res = randr.get_screen_resources(window)
for mode in res.modes:
    w, h = mode.width, mode.height
print('Width: {}, height: {}'.format(w, h))
Get display count and resolution for each display in Python without xrandr