python - How to put special character between string -


this question has answer here:

i have string "0013a200305eff96". want change in form "\x00\x13\xa2\x00\x30\x5e\xff\x96". special character "\x". how can in time efficient way?

python2

>>> "0013a200305eff96".decode("hex") '\x00\x13\xa2\x000^\xff\x96' 

python3

>>> bytes.fromhex("0013a200305eff96") b'\x00\x13\xa2\x000^\xff\x96' 

Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -