본문 바로가기
RPA

Python 전체 화면 좌표값과 해상도

by Sol95 2023. 5. 3.
728x90

Python 전체 화면 좌표값과 해상도

import pyautogui
fore = pyautogui.getActiveWindow()
#전체 화면에 대한 좌표값과 해상도
print("-------------------")
print(fore.title) #선택된 화면
print(fore.size) #width, height 사이즈
print(fore.left, fore.top, fore.right, fore.bottom)
print("-------------------")
#실행되어 있는 윈도우 창 전체
for win in pyautogui.getAllWindows():
    print(win)

출력 결과값

pythonProjectTest – test.py
Size(width=1936, height=1056)
-1928 -8 8 1048

-------------------------------------------------------------------------------------------------------

윈도우 창 전체에 대한 출력값 Sample

<Win32Window left="0", top="1", width="260", height="160", title="스티커 메모">

<Win32Window left="0", top="1012", width="160", height="28", title="PlaceholderWindow">
<Win32Window left="271", top="171", width="1139", height="641", title="pythonProject">

<Win32Window left="0", top="0", width="0", height="0", title="">
<Win32Window left="626", top="297", width="668", height="48", title="검색 창">

728x90
반응형

댓글