0

i have a string of bytes like temp="101110110011" i want to write this string in binary file. i did it by :

with open("some binary file.bin", "wb") as f:
    bytes = str.encode (some string)
    f.write(bytes)

but because I use it for huffman encoding it will make my bin file size larger

how to save above string as binary directly in python 3 my string range is more than 32 bits

0 Answers0