Just like WinActivate in AutoHotkey, this module lets you easily activate and focus an opened window.
from pyWinActivate import win_activate, win_wait_active
# Activate window with partial winTitle string.
win_activate(window_title="Book1", partial_match=True)
# Activate window with exact winTitle string.
win_activate(window_title="Book1.xlsx - Excel", partial_match=False)
# Wait for the specified window to be active.
# You can pass an exception for a popup window's title. If not needed leave as None or skip entirely.
# Note: works only with a full title
win_wait_active(win_to_wait=Book1.xlsx - Excel, exception="potential popup window", message=False)