Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

text to binary python

a_string = "abc"

a_byte_array = bytearray(a_string, "utf8")

byte_list = []

for byte in a_byte_array:

    binary_representation = bin(byte)
    byte_list.append(binary_representation)

print(byte_list)

#Output ['0b1100001', '0b1100010', '0b1100011']
Source by www.kite.com #
 
PREVIOUS NEXT
Tagged: #text #binary #python
ADD COMMENT
Topic
Name
3+6 =