Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: hex decoding in Python 3
Post: RE: hex decoding in Python 3

Quote:Maybe it is easier if you work with byte-strings instead of array of bytes: response = b'' ... while response[-2:] != b'\x07\x0f' and time.time() - start < self.timeout: respons...
rdirksen General Coding Help 2 4,599 May-12-2019, 11:49 AM
    Thread: hex decoding in Python 3
Post: hex decoding in Python 3

I am converting a program from P2.7 to P3.5 I receive from a serial interface an array of bytes. When I print the array in P2.7 I get this: Raw ['07', 'f3', '07', 'f0', '00', 'd2', '09', '50', '47...
rdirksen General Coding Help 2 4,599 May-11-2019, 12:16 PM
    Thread: typeerror: 'str' does not support the buffer interface
Post: RE: typeerror: 'str' does not support the buffer i...

**smile** yeah that helps.
rdirksen General Coding Help 3 10,348 Mar-11-2018, 12:57 PM
    Thread: typeerror: 'str' does not support the buffer interface
Post: RE: typeerror: 'str' does not support the buffer i...

the complete errormessage: Error:Traceback (most recent call last): File "/home/pi/whr-control/ventserver.py", line 15, in <module> ser.write('\x07\xF0\x00\x0F\x00\xBC\x07\x0F') File "/u...
rdirksen General Coding Help 3 10,348 Nov-12-2017, 01:37 PM
    Thread: typeerror: 'str' does not support the buffer interface
Post: typeerror: 'str' does not support the buffer inter...

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...
rdirksen General Coding Help 3 10,348 Nov-12-2017, 12:04 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020