On 26Aug2020 15:09, Chris Green <c...@isbd.net> wrote:
>2qdxy4rzwzuui...@potatochowder.com wrote:
>> Join bytes objects with a byte object:
>>
>>     b"\n".join(popmsg[1])
>
>Aaahhh!  Thank you (and the other reply).

But note: joining bytes like strings is uncommon, and may indicate that 
you should be working in strings to start with. Eg you may want to 
convert popmsg from bytes to str and do a str.join anyway. It depends on 
exactly what you're dealing with: are you doing text work, or are you 
doing "binary data" work?

I know many network protocols are "bytes-as-text, but that is 
accomplished by implying an encoding of the text, eg as ASCII, where 
characters all fit in single bytes/octets.

Cheers,
Cameron Simpson <c...@cskk.id.au>
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to