Nov-12-2017, 12:04 PM
I have a very simple program to write a (HEX) string to a USB device
import serial while True: ser = serial.Serial(port = '/dev/ttyUSB0', baudrate = 9600, bytesize = serial.EIGHTBITS, parity = serial.PARITY_NONE, stopbits = serial.STOPBITS_ONE, timeout = 10) response = [] ser.write("\x07\xF0\x00\x0F\x00\xBC\x07\x0F") response.append(ser.read().encode('hex'))this runs fine in Python 2.7.9 but in version 3.4.2 I get the error message
"TypeError: 'str' does not support the buffer interface"
what should I modify in the .write command to avoid this problem?