搜尋此網誌

2020年5月18日 星期一

How to read the screen resolution by python3.7


If we want to know the windows' screen resolution, we can use the win32api and win32con to get the value from windows.
The example as below.

import win32api, win32con

y = win32api.GetSystemMetrics(win32con.SM_CYSCREEN)
x = win32api.GetSystemMetrics(win32con.SM_CXSCREEN)

print(x, ",", y)
The execution result:

2560 , 1080

Process finished with exit code 0









沒有留言:

張貼留言