Hello McLightning, welcome "a discussion board"
Suggestions, following your initial approach (I am supposing that a and b are numbers):
Decoding at receiver:
msg = "%d %d" % (a,b) # space is the field delimiter !
However, take care when receiving, ensure recv got all expected bytes. socket.makefile() is available for TCP/P sockets. If it is available for bluetooth sockets as well I recommend to use it instead recv/send since you will have a better flow control for text oriented messages.
msg = msg.split() # space is the field delimiter !
a = int(msg)
b = int(msg)
If you want something more sophisticated, I recommend simplejson. Using simplejson you can serialize complete objects instead only string. You will find a example in the thread.