Python cython hidapi写入错误
我正试图写一个USB设备连接到安装了raspbian的raspberry pi 3 错误:Python cython hidapi写入错误,python,usb,cython,hidapi,Python,Usb,Cython,Hidapi,我正试图写一个USB设备连接到安装了raspbian的raspberry pi 3 错误: File "<stdin>", line 1 h.write([81 80 73 71 83 183 169 13]) ^ SyntaxError: invalid syntax 这个代码有什么问题?根据库中的文档,它接受任何整数列表 我用它作为参考:列表中缺少逗号分隔 列表应,(逗号)分隔 更改h.write([81 80 73 71 83 1
File "<stdin>", line 1
h.write([81 80 73 71 83 183 169 13])
^
SyntaxError: invalid syntax
这个代码有什么问题?根据库中的文档,它接受任何整数列表
我用它作为参考:列表中缺少逗号分隔 列表应
,
(逗号)分隔
更改h.write([81 80 73 71 83 183 169 13])
到
h.write([81,80,73,71,83,183,169,13])
#!/usr/bin/python
import hid
h = hid.device()
h.open(0x0665, 0x5161)
h.set_nonblocking(1) // Returns 0
h.write([0, 63, 35, 35] + [0] * 61) // Returns -1
h.write([81 80 73 71 83 183 169 13]) //Throws error above.