Incoming datas difficult to read "\r\n" and "\n"

Bischoop Bischoop at vimart.net
Fri Nov 6 07:46:01 EST 2020


On 2020-11-06, Chris Angelico <rosuav at gmail.com> wrote:

> You're currently dumping out the raw bytes. Not very interesting, and
> that's why it's not easy to read. I would recommend (a) decoding the
> bytes to text, and (b) splitting it on "\r\n", thus getting it
> line-by-line.
>
> What you may want to consider, though, is using an actual IRC library.
> It'll handle all kinds of details for you :)
>

right

I've changed the line to:
print(data.decode('utf8'))

and prints it now nice but not sure how to apply yet:

print (string.splitlines( ))

and PING PONG matter.



More information about the Python-list mailing list