This package provides the Python projection for the Windows.Devices.Enumeration namespace of the Windows Runtime (WinRT) APIs. It allows Python developers to discover and manage hardware devices available on a Windows system. Part of the larger PyWinRT project, it is currently at version 3.2.1 and follows the PyWinRT release cadence, often tied to Windows SDK updates.
pip install winrt-windows-devices-enumerationVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to asynchronously list all discoverable devices using the `DeviceInformation.FindAllAsync()` method. It prints the name and ID of each found device. Remember that WinRT operations are often asynchronous and require `await` and `asyncio`.
Consult the official migration guide (e.g., `pywinrt/scripts/2to3/README.md` on GitHub). Update imports and adjust type casting/boxing logic. `box`/`unbox` are now in `winrt.system`, and `Object.as_()` replaces previous casting patterns.
Always `await` asynchronous operations (e.g., `await obj.DoSomethingAsync()`). Ensure your code runs within an `async` function and is executed by `asyncio.run()`. From `v3.2.0`, you can use `obj.DoSomethingAsync().get()` or `obj.DoSomethingAsync().wait()` for synchronous calls.
Always install `winrt-windows-devices-enumeration==2.0.1` (or a later `2.x` release) if you need a specific version in the 2.x range, instead of `2.0.0`.
Access static events directly on the class (e.g., `MyWinRTClass.StaticEvent += handler`) rather than through instances or older patterns. Refer to updated `pywinrt` documentation for specific event handling examples.
No dependency data recorded yet.