Obtenir la taille de l'écran Python
>>> import pyautogui
>>> width, height= pyautogui.size()
>>> print(width)
1366
>>> print(height)
768
Doubtful Dingo
>>> import pyautogui
>>> width, height= pyautogui.size()
>>> print(width)
1366
>>> print(height)
768
from os import get_terminal_size
size = get_terminal_size() # Columns, Lines
from win32api import GetSystemMetrics
print("Width =", GetSystemMetrics(0))
print("Height =", GetSystemMetrics(1))
from screeninfo import get_monitors
screen = get_monitors()[0]
# if that raises an error, put this first
# from os import environ
# environ['DISPLAY'] = ':0.0'
print(screen)
from win32api import GetSystemMetrics
screen_width = GetSystemMetrics(0)
screen_height = GetSystemMetrics(1)