serial.write() method in pyserial seems to only send string data. I have arrays like [0xc0,0x04,0x00] and want to be able to send/receive them via the serial port? Are there any
You need to convert your data to a string
"\xc0\x04\x00"
Null characters are not a problem in Python -- strings are not null-terminated the zero byte behaves just like another byte "\x00".
"\x00"
One way to do this:
>>> import array >>> array.array('B', [0xc0, 0x04, 0x00]).tostring() '\xc0\x04\x00'