I’ve tried the following methods but none would work on Linux
JavaScript
x
from win32.win32api import GetSystemMetrics
print(GetSystemMetrics(0), GetSystemMetrics(1))
JavaScript
from ctypes import windll
info = windll.user32
print(info.GetSystemMetrics(0), info.GetSystemMetrics(1))
Advertisement
Answer
Try using tkinter
, like:
JavaScript
from tkinter import *
root = Tk()
root.withdraw()
height,width = root.winfo_screenheight(),root.winfo_screenwidth()
print(height,width)