Strange extra f added to bytes object

R

Robert Jackson

I am very new to python so I'll apologize up front if this is some
boneheaded thing. I am using python and pyserial to talk to an embedded
pic processor in a piece of scientific equipment. I sometimes find the
when I construct the bytes object to write it adds an extra f to the first
byte.

For example if I have b'\x03\x66\x02\x01\xaa\xbb' it evaluates
to b'\x03f\x02\x01\xaa\xbb', which doesn't even seem valid.

Can anyone shine some light this?
 
P

Peter Pearson

--089e0160b7be912b9e04e81a52b2
Content-Type: text/plain; charset=ISO-8859-1

I am very new to python [snip]

Welcome.


. . . I sometimes find the
when I construct the bytes object to write it adds an extra f to the first
byte.

For example if I have b'\x03\x66\x02\x01\xaa\xbb' it evaluates
to b'\x03f\x02\x01\xaa\xbb', which doesn't even seem valid.

Can anyone shine some light this?

"f" is the same as \x66; nothing has been changed.
 
J

Joel Goldstick

--089e0160b7be912b9e04e81a52b2
Content-Type: text/plain; charset=ISO-8859-1

I am very new to python [snip]

Welcome.


. . . I sometimes find the
when I construct the bytes object to write it adds an extra f to the first
byte.

For example if I have b'\x03\x66\x02\x01\xaa\xbb' it evaluates
to b'\x03f\x02\x01\xaa\xbb', which doesn't even seem valid.

Can anyone shine some light this?

"f" is the same as \x66; nothing has been changed.

really? I would expect that \x66 = 0110 0110 and f = 1111
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top