What's the easiest way in python to concatenate string with binary values ?
sep = 0x1
data = ["abc","def","ghi","jkl"]
Looking for result data "abc0x1def0x1ghi0x1jkl"
with the 0x1 being binary value not string "0x1".
I think
joined = '\x01'.join(data)
should do it. \x01
is the escape sequence for a byte with value 0x01.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With