Answers for "how to get screen width and height in python"

11

get screen size python

>>> import pyautogui

>>> width, height= pyautogui.size()

>>> print(width)
1366

>>> print(height)
768
Posted by: Guest on July-16-2020
0

screen size tkinter

import tkinter as tk

root = tk.Tk()

screen_width = root.winfo_screenwidth()
screen_height = root.winfo_screenheight()
Posted by: Guest on March-09-2020
3

get size of window tkinter

# Where w is a widget:
w.winfo_height()
w.winfo_width()
Posted by: Guest on March-10-2020
1

python get screen size

from win32api import GetSystemMetrics

print("Width =", GetSystemMetrics(0))
print("Height =", GetSystemMetrics(1))
Posted by: Guest on May-08-2021
1

screen size python

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)
Posted by: Guest on June-08-2021

Code answers related to "how to get screen width and height in python"

Python Answers by Framework

Browse Popular Code Answers by Language