vpelletier / python-hidraw Goto Github PK
View Code? Open in Web Editor NEWPure-python linux hidraw bindings
License: GNU General Public License v2.0
Pure-python linux hidraw bindings
License: GNU General Public License v2.0
I'm trying to use Your code, but I'm stuck right at the beginning.
The following test code (along with several variations):
from pathlib import Path
from pyhidraw import HIDRaw
def get_devices():
paths = sorted([f for f in Path('/dev/input').iterdir() if f.name.startswith('event')],
key=lambda f: int(f.name.replace('event', '')))
devices = []
for f in paths:
with f.open() as fd:
dev = HIDRaw(fd)
name = dev.getName()
desc = dev.getRawReportDescriptor()
devices.append((str(f), name, desc))
return devices
dd = get_devices()
for d in dd:
print(d)
bombs with the following error:
/usr/bin/python3.5 /home/valeria/MyProject/VoCore/trasmissione-telematica/Communications/Client/hidraw.py
Traceback (most recent call last):
File "/home/valeria/MyProject/VoCore/trasmissione-telematica/Communications/Client/hidraw.py", line 18, in <module>
dd = get_devices()
File "/home/valeria/MyProject/VoCore/trasmissione-telematica/Communications/Client/hidraw.py", line 12, in get_devices
name = dev.getName()
File "/home/valeria/MyProject/VoCore/trasmissione-telematica/Communications/Client/pyhidraw.py", line 93, in getName
self._ioctl(_HIDIOCGRAWNAME(length), name, True)
File "/home/valeria/MyProject/VoCore/trasmissione-telematica/Communications/Client/pyhidraw.py", line 59, in _ioctl
result = fcntl.ioctl(self._device, func, arg, mutate_flag)
OSError: [Errno 22] Invalid argument
Process finished with exit code 1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.