Skip to content

Instantly share code, notes, and snippets.

@gevasiliou
Last active October 6, 2016 09:10
Show Gist options
  • Save gevasiliou/14ee030741e12c4d01532ce371754726 to your computer and use it in GitHub Desktop.
Save gevasiliou/14ee030741e12c4d01532ce371754726 to your computer and use it in GitHub Desktop.
List System Devices with Python
# Sample Code using python-evdev tutorials to list properties of all devices.
from evdev import InputDevice, list_devices
from pprint import pprint #the pretty print modules
for dev in list_devices(): # scan all devices
device = InputDevice(dev)
pprint(('device: ', device,'-',device.name))
cap = device.capabilities(verbose=True,absinfo=True)
pprint(('Device Capabilities:', cap))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment