zeth / inputs

Cross-platform Python support for keyboards, mice and gamepads
BSD 3-Clause "New" or "Revised" License
273 stars 88 forks source link

'Keyboard' object has no attribute 'name' #13

Closed antonagestam closed 6 years ago

antonagestam commented 7 years ago

Using the example from the readme in a file called devices.py, I stumbled on an AttributeError.

from inputs import devices

for device in devices:
    print(device)
$ python devices.py
Traceback (most recent call last):
  File "devices.py", line 4, in <module>
    print(device)
  File "/Users/agestuds/python_projects/controller/.controller/lib/python3.5/site-packages/inputs.py", line 2031, in __str__
    return self.name
AttributeError: 'Keyboard' object has no attribute 'name'

Using macOS Sierra (10.12.3) and with inputs and pyobjc installed in a virtualenv with python version 3.5.2.

BrianRamsay commented 7 years ago

Same issue for me, with El Capitan, on python 2.7 or 3

TheMadHatt3r commented 7 years ago

I also have this error running Win7 - Python 3.5 Anyone find a solution?

Slippersen commented 6 years ago

I am experiencing the same issue. Windows 10 - Python 3.6.1.

SamyBencherif commented 6 years ago

Workaround:

from inputs import devices

for device in devices:
    print([device])