Re: Strange extra f added to bytes object

2013-10-06 Thread Robert Jackson
Thank you all. It was unfortunate that it was f since I thought it was some strange mistaken hex nibble. All very clear and helpful. On Sun, Oct 6, 2013 at 9:07 PM, Steven D'Aprano < steve+comp.lang.pyt...@pearwood.info> wrote: > On Sun, 06 Oct 2013 20:39:39 -0400, Ned Batchelder wrote: > > >

Re: Strange extra f added to bytes object

2013-10-06 Thread Steven D'Aprano
On Sun, 06 Oct 2013 20:39:39 -0400, Ned Batchelder wrote: > When Python displays a string, is uses A byte string. > the ASCII character if it can, and a hex escape if it can't. When you > use a hex value that is a valid ASCII character, it will display the > character. Obviously for Python 2 t

Re: Strange extra f added to bytes object

2013-10-06 Thread Joel Goldstick
On Sun, Oct 6, 2013 at 8:38 PM, MRAB wrote: > On 06/10/2013 23:47, Robert Jackson wrote: >> >> 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 some

Re: Strange extra f added to bytes object

2013-10-06 Thread Terry Reedy
On 10/6/2013 6:47 PM, Robert Jackson wrote: I am very new to python so I'll apologize up front if this is some Welcome to a mostly great language. 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 w

Re: Strange extra f added to bytes object

2013-10-06 Thread Ian Kelly
On Sun, Oct 6, 2013 at 6:39 PM, Joel Goldstick wrote: >> "f" is the same as \x66; nothing has been changed. > > really? I would expect that \x66 = 0110 0110 and f = The f here is the ASCII character f, not the hex digit f: >>> bin(ord(b'f')) '0b1100110' -- https://mail.python.org/mailman/l

Re: Strange extra f added to bytes object

2013-10-06 Thread Ned Batchelder
On 10/6/13 6:47 PM, Robert Jackson wrote: 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 writ

Re: Strange extra f added to bytes object

2013-10-06 Thread Joel Goldstick
On Sun, Oct 6, 2013 at 8:32 PM, Peter Pearson wrote: > On Sun, 6 Oct 2013 18:47:38 -0400, Robert Jackson wrote: >> --089e0160b7be912b9e04e81a52b2 >> Content-Type: text/plain; charset=ISO-8859-1 >> >> I am very new to python > [snip] > > Welcome. > > >> . . . I sometimes find the >> when I constru

Re: Strange extra f added to bytes object

2013-10-06 Thread MRAB
On 06/10/2013 23:47, Robert Jackson wrote: 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

Re: Strange extra f added to bytes object

2013-10-06 Thread Peter Pearson
On Sun, 6 Oct 2013 18:47:38 -0400, Robert Jackson wrote: > --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.

Strange extra f added to bytes object

2013-10-06 Thread 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 e