Re: How do I do this in Python 3 (string.join())?

2020-08-28 Thread Chris Green
Cameron Simpson wrote: [snip] > > >The POP3 processing is solely to collect E-Mail that ends up in the > >'catchall' mailbox on my hosting provider. It empties the POP3 > >catchall mailbox, checks for anything that *might* be for me or other > >family members then just deletes the rest. > > Ver

Re: How do I do this in Python 3 (string.join())?

2020-08-27 Thread Cameron Simpson
On 27Aug2020 14:36, Chris Green wrote: >Cameron Simpson wrote: >> I do ok, though most of my message processing happens to messages >> already landed in my "spool" Maildir by getmail. My setup uses getmail >> to get messages with POP into a single Maildir, and then I process the >> message files

Re: How do I do this in Python 3 (string.join())?

2020-08-27 Thread Chris Green
Cameron Simpson wrote: > On 27Aug2020 09:16, Chris Green wrote: > >Cameron Simpson wrote: > >> 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.

Re: How do I do this in Python 3 (string.join())?

2020-08-27 Thread Cameron Simpson
On 27Aug2020 09:16, Chris Green wrote: >Cameron Simpson wrote: >> 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 >> exactl

Re: How do I do this in Python 3 (string.join())?

2020-08-27 Thread Chris Green
Cameron Simpson wrote: > On 26Aug2020 15:09, Chris Green 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

Re: How do I do this in Python 3 (string.join())?

2020-08-26 Thread Cameron Simpson
On 26Aug2020 15:09, Chris Green 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 i

Re: How do I do this in Python 3 (string.join())?

2020-08-26 Thread Chris Green
2qdxy4rzwzuui...@potatochowder.com wrote: > On 2020-08-26 at 14:22:10 +0100, > Chris Green wrote: > > > I have the following line in Python 2:- > > > > msgstr = string.join(popmsg[1], "\n") # popmsg[1] is a list containing > the lines of the message > > > > ... so I changed it to:- > > > >

Re: How do I do this in Python 3 (string.join())?

2020-08-26 Thread MRAB
On 2020-08-26 14:22, Chris Green wrote: I have the following line in Python 2:- msgstr = string.join(popmsg[1], "\n") # popmsg[1] is a list containing the lines of the message ... so I changed it to:- s = "\n" msgstr = s.join(popmsg[1]) # popmsg[1] is a list containin

Re: How do I do this in Python 3 (string.join())?

2020-08-26 Thread D'Arcy Cain
On 2020-08-26 09:22, Chris Green wrote: > I have the following line in Python 2:- > > msgstr = string.join(popmsg[1], "\n") # popmsg[1] is a list > containing the lines of the message > > ... so I changed it to:- > > s = "\n" > msgstr = s.join(popmsg[1]) # popmsg[1] is a l

Re: How do I do this in Python 3 (string.join())?

2020-08-26 Thread 2QdxY4RzWzUUiLuE
On 2020-08-26 at 14:22:10 +0100, Chris Green wrote: > I have the following line in Python 2:- > > msgstr = string.join(popmsg[1], "\n") # popmsg[1] is a list > containing the lines of the message > > ... so I changed it to:- > > s = "\n" > msgstr = s.join(popmsg[1]) # po

How do I do this in Python 3 (string.join())?

2020-08-26 Thread Chris Green
I have the following line in Python 2:- msgstr = string.join(popmsg[1], "\n") # popmsg[1] is a list containing the lines of the message ... so I changed it to:- s = "\n" msgstr = s.join(popmsg[1]) # popmsg[1] is a list containing the lines of the message However this sti