Airtest API
use device()
to get the resolution:
from airtest.core.api import *
w,h = device().get_current_resolution()
Windows method
import win32api, win32con
x_resolution = win32api.GetSystemMetrics(win32con.SM_CXSCREEN)
y_resolution = win32api.GetSystemMetrics(win32con.SM_CYSCREEN)