z230
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
"""
|
||||
Test skript — zobrazí počet monitorů, jejich rozlišení a který je primární.
|
||||
"""
|
||||
import sys
|
||||
|
||||
try:
|
||||
from screeninfo import get_monitors
|
||||
monitors = get_monitors()
|
||||
print(f"Počet monitorů: {len(monitors)}\n")
|
||||
for i, m in enumerate(monitors):
|
||||
primary = " ← PRIMÁRNÍ" if getattr(m, "is_primary", False) else ""
|
||||
print(f" Monitor {i+1}: {m.width}x{m.height} | pozice x={m.x}, y={m.y}{primary} | název: {getattr(m, 'name', '?')}")
|
||||
except ImportError:
|
||||
print("Knihovna 'screeninfo' není nainstalována — instaluji...")
|
||||
import subprocess
|
||||
subprocess.check_call([sys.executable, "-m", "pip", "install", "screeninfo", "--break-system-packages", "-q"])
|
||||
from screeninfo import get_monitors
|
||||
monitors = get_monitors()
|
||||
print(f"Počet monitorů: {len(monitors)}\n")
|
||||
for i, m in enumerate(monitors):
|
||||
primary = " ← PRIMÁRNÍ" if getattr(m, "is_primary", False) else ""
|
||||
print(f" Monitor {i+1}: {m.width}x{m.height} | pozice x={m.x}, y={m.y}{primary} | název: {getattr(m, 'name', '?')}")
|
||||
Reference in New Issue
Block a user