#!/usr/bin/env python import sys import labhw name = sys.argv[1] devices = labhw.list_USB_devices() try: print(devices[name]) except KeyError as e: raise RuntimeError(f"unknown device {name}")