mirror of
https://github.com/acatoire/bipbipzizik.git
synced 2026-03-10 08:01:18 +00:00
19 lines
388 B
Python
19 lines
388 B
Python
import os.path
|
|
from evdev import InputDevice, list_devices
|
|
|
|
devices = [InputDevice(fn) for fn in list_devices()]
|
|
path = os.path.dirname(os.path.realpath(__file__))
|
|
i = 0
|
|
print "Choose the reader from list"
|
|
for dev in devices:
|
|
print i, dev.name
|
|
i += 1
|
|
|
|
dev_id = int(raw_input('Device Number: '))
|
|
|
|
with open(path + '/deviceName.txt','w') as f:
|
|
f.write(devices[dev_id].name)
|
|
f.close()
|
|
|
|
|