This post can solve your problem .
Assume, you are having following scenario .
source_addr =
source_addr_long =
# Coordinator transmit packet to any router .
# Decision can be taken at run time by coordinator.
# One to many nodes transmission is thus possible.
xbee1.tx(
frame='0x1'
, dest_addr=bytearray( int(x,16) for x in source_addr)
, data='Hi'
, dest_addr_long= bytearray( int(x,16) for x in source_addr_long)
)
# It will Work . Go to very basic thing .
# string to int , int to hex , hex to int .
hex(19) => '0x13'
int('0x13',16) => 19
x = '0x13'
then int(x,16) will be 19