{"id":24482,"library":"pywinbox","title":"PyWinBox","description":"Cross-platform and multi-monitor toolkit to handle rectangular areas and window boxes. Current version 0.7 provides support for Windows, Linux (X11, not Wayland), and macOS. Development is active but releases are irregular.","status":"active","version":"0.7","language":"python","source_language":"en","source_url":"https://github.com/Kalmat/PyWinBox","tags":["window-management","cross-platform","multi-monitor","bounding-box"],"install":[{"cmd":"pip install pywinbox","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required at runtime for type hints (since v0.6).","package":"typing_extensions","optional":false}],"imports":[{"note":"Main class for cross-platform window/area handling.","symbol":"PyWinBox","correct":"from pywinbox import PyWinBox"}],"quickstart":{"code":"from pywinbox import PyWinBox\n\n# Create a PyWinBox instance\nbox = PyWinBox()\n\n# Get the window of a running application (e.g., notepad on Windows, gnome-terminal on Linux)\n# Replace 'notepad' with the actual window title\n# For Linux, the title may not match exactly; use 'gnome-terminal' as an example\ntry:\n    window = box.getWindow(title='notepad')\n    print(f\"Window found: {window}\")\n    print(f\"Bounding box: {box.getBox(title='notepad')}\")\nexcept Exception as e:\n    print(f\"Error: {e}\")","lang":"python","description":"Create a PyWinBox instance and retrieve a window by title, then print its bounding box."},"warnings":[{"fix":"Run your application under X11 (e.g., set environment variable XDG_SESSION_TYPE=x11 or switch display manager).","message":"On Linux, PyWinBox relies on X11 and may not work under Wayland. Ensure you are running in an X11 session.","severity":"gotcha","affected_versions":"all"},{"fix":"Use tools like 'xdotool' or 'wmctrl' on Linux to inspect exact window titles. On Windows, use Spy++ or similar.","message":"Window titles are case-sensitive and must match exactly on Windows. On Linux, the title may not be the full window title seen by the user.","severity":"gotcha","affected_versions":"all"},{"fix":"Import specific symbols: from pywinbox import PyWinBox","message":"The old import path 'from pywinbox import *' or 'import pywinbox' directly may expose internal/private elements. Use explicit imports as shown in the documentation.","severity":"deprecated","affected_versions":">=0.4"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use: from pywinbox import PyWinBox","cause":"Incorrect import path (e.g., import pywinbox) or older version that uses different class name.","error":"AttributeError: module 'pywinbox' has no attribute 'PyWinBox'"},{"fix":"Verify the exact window title (case-sensitive) and ensure the window is open.","cause":"Window title is misspelled, case mismatch, or window does not exist.","error":"pywinbox.exceptions.WindowNotFoundError: Window with title '...' not found"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}