Read an bytearray from json
Posted: Thu May 13, 2021 3:47 pm
Hi,
unfortunately it's not possible to store bytearrays in json-files. If i use the string-representation of an bytearray, e .g (b\xe5V\xb5\x01<: i get (bxe5V\xb5x01<: after loading the file.
If i escape the backslashes (b\\xe5V\\xb5\\x01<: i get the same string (with double-backslashes) after loading the file.
How to get single backslashes or is there any other proper way to store bytearrays in python.
Thank you
unfortunately it's not possible to store bytearrays in json-files. If i use the string-representation of an bytearray, e .g (b\xe5V\xb5\x01<: i get (bxe5V\xb5x01<: after loading the file.
If i escape the backslashes (b\\xe5V\\xb5\\x01<: i get the same string (with double-backslashes) after loading the file.
How to get single backslashes or is there any other proper way to store bytearrays in python.
Thank you