Skip to main content

pyWinActivate

Just like WinActivate in AutoHotkey, this module lets you easily activate and focus an opened window.

Examples

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)

Changes

1.3.0

Added function check_win_exist()

1.2.0

Refactored win_activate()

It now takes window_title and partial_match(T/F) as arguments instead of window and titlematchmode(0/1)

1.1.1

Changed function names to follow PEP8 guidelines

Changed get_app_list() to not use mutable deafults

Added argument to win_wait_active() to turn off the message while waiting. Its True by default.

Changed some function argument names to be more desriptive.

Special thanks to reddit user u/JohnnyJordaan with help on the code simplification.

Metadata

Release files for pyWinActivate 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyWinActivate 1.3.0
File Size Uploaded
pyWinActivate-1.3.0.tar.gz 3.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyWinActivate 1.3.0
File Interpreter ABI Platform
pyWinActivate-1.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.1 kB

Release files / pyWinActivate-1.3.0.tar.gz

Download URL pyWinActivate-1.3.0.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
56482f42c219c0f9a0818524acac9581c5691010f6f36b78445afaf5fad9d1bd
BLAKE2b-256 checksum
How to use checksums
84417c4cdd49b4c888f7d0a5a7928f60dbe2c532a2995752f85a9e26cea5c51e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / pyWinActivate-1.3.0-py3-none-any.whl

Download URL pyWinActivate-1.3.0-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
272198c57123fedc18675592d0a5427615faa3298e637ec9d001b09c52edaca6
BLAKE2b-256 checksum
How to use checksums
2e2605f60453597b7c17978f2fb070720180ec52db8464c549083314a295374b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page