0
我有下面的代码,我希望在运行时感受函数映射的参数。它应该像Python中函数的参数
#devices = map(InputDevice, ('/dev/input/event15','/dev/input/event16'))
但是,当我尝试在运行时执行它,它不起作用。这里是我的尝试:
readers = ""
devices = map(InputDevice, list_devices())
for dev in devices:
if "深" in dev.name or "Barcode" in dev.name:
if readers == "":
readers = "'" + dev.fn + "'"
else:
readers = readers + ", '" + dev.fn + "'"
devices = map(InputDevice, (readers))
,读者准确显示'的/ dev /输入/ event15', '的/ dev /输入/ event16',但此字符串不为参数工作。我猜这是因为逗号不起作用。有谁知道我该怎么做?
此功能是evdev的一部分。
从此开始感谢! 此致敬礼, Erik
非常感谢。它完美的作品。这正是我需要的! –