> Does this help?
THANKS!! Yes it definately helped. everything is so much clearer now. i always
used to wonder about the u"" syntax in python 2___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.or
On 23/03/13 15:22, Lolo Lolo wrote:
You can use bytes() function:
bytes('%d' % 3, 'utf-8')
b'3'
-m
thanks this has solved everything. can i ask if this is an issue only in python
3 where sockets cant send strings? the docs state the argument is a string, but
i believe that was for 2.7
>You can use bytes() function:
bytes('%d' % 3, 'utf-8')
>b'3'
>-m
thanks this has solved everything. can i ask if this is an issue only in python
3 where sockets cant send strings? the docs state the argument is a string, but
i believe that was for 2.7. I knew nothing about b'' or bytes
On 03/22/2013 11:29 PM, Lolo Lolo wrote:
using a socket im trying to send a message between connections. it was a string and my python
complained:
> "TypeError: must be bytes or buffer, not str" .. so i put a b infront
of the string. now this works fine but the problem is after recieving
this
using a socket im trying to send a message between connections. it was a string
and my python complained:
"TypeError: must be bytes or buffer, not str" .. so i put a b infront of the
string. now this works fine but the problem is after recieving this message, i
need to send it back with an int