[Tutor] send issue

Lolo Lolo losermeloser at yahoo.com
Sat Mar 23 04:29:47 CET 2013


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 included, like:
message = 'Thankyou!, processed connection number %d' % connections        connections being an int.
again this is a string, but puttng a b infront of that strong wont work, it returns:
TypeError: unsupported operand type(s) for %: 'bytes' and 'int'
 
i tried everything but i cant seem to get past this little obstacle. im using python 3 on windows vista
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130322/95fc9e07/attachment.html>


More information about the Tutor mailing list