I am trying to convert the type of the data fetched from the database into the binary
type. The data fetched from the database is in the form of a list.
Below is the sample code:
def WriteData(data):
jsonData = json.dumps(data)
binaryData = ' '.join(format(ord(letter), 'b') for letter in jsonData)
print(type(binaryData))
filePointer = io.BytesIO(binaryData)
The output of the code is:
<class 'str'>