In python3 I have some bytes. I want to export them to C source code. Outside python I use \"xxd -i binary_file\" command.
Example:
x = b\'abc123\' print
1. print([hex(i) for in x]) 2. print(a.hex())
Results will be:
1. ['0x61', '0x62', '0x63', '0x31', '0x32', '0x33'] 2. '616263313233'