>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() before today. 
thanks again
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to