我试着让这些例子从pywinusb开始工作,但没有结果。
我的设计是:
我得到了这个输出:
E:\pywinusb-0.3.2\examples>python show_hids.py
Found HID class devices!, writting details...
Traceback (most recent call last):
File "show_hids.py", line 71, in <module>
print_all()
File "show_hids.py", line 68, in print_all
hid.core.show_hids()
File "D:\Python33\lib\site-packages\pywinusb-0.3.2-py3.3.egg\pywinusb\hid\core.py", line 1563, in show_hids
File "D:\Python33\lib\codecs.py", line 356, in write
self.stream.write(data)
TypeError: must be str, not bytes正如您所看到的,我直接从控制台运行脚本。
我是一个经验丰富的C程序员,正在学习Python。它是否与Python 2/3不兼容?我在想我的设置有什么不对。我不认为这些例子是错误的。
发布于 2015-03-21 16:48:36
如果可能的话,试试Python2.7,这是主要的测试平台(可能很快就会改变)。
最新的代码在github存储库上。我刚刚测试了使用pyWinUsb版本0.3.6在Python3.3(和3.4)上工作的情况
https://stackoverflow.com/questions/18807878
复制相似问题