Thank you for reading this.
As an exercise, and for no other purpose, I'm trying to convert some C++
code that I put together 17 years ago. I'm very rusty and hours of
Internet searches have made me more confused that I was to start with.
The following works under Python2 but not under Python
Phil wrote:
> Thank you for reading this.
>
> As an exercise, and for no other purpose, I'm trying to convert some C++
> code that I put together 17 years ago. I'm very rusty and hours of
> Internet searches have made me more confused that I was to start with.
>
> The following works under Pytho
On 26/02/17 06:44, Phil wrote:
> s.connect((host, 1210))
> data = "GET_LIST"
This is a string, you need to use bytes.
data = bytes("GET_LIST",'utf8')
> s.sendall(data)
> #s.sendto(data, (host, 1210))
> s.shutdown(1)
> Traceback (most recent call last):
>File "/home/phil/Python/predict_clie
On 26/02/17 18:42, Alan Gauld via Tutor wrote:
On 26/02/17 06:44, Phil wrote:
s.connect((host, 1210))
data = "GET_LIST"
This is a string, you need to use bytes.
data = bytes("GET_LIST",'utf8')
Thank you Peter and Alan for your response.
Converting "data" to bytes worked, of course. Now I
Phil wrote:
> On 26/02/17 18:42, Alan Gauld via Tutor wrote:
>> On 26/02/17 06:44, Phil wrote:
>>
>>> s.connect((host, 1210))
>>> data = "GET_LIST"
>>
>> This is a string, you need to use bytes.
>>
>> data = bytes("GET_LIST",'utf8')
>>
>
> Thank you Peter and Alan for your response.
>
> Converti
On 26/02/17 19:41, Peter Otten wrote:
Try
buf.decode("utf-8")
Thank you once again Peter.
--
Regards,
Phil
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor