encode - Python string to bytearray and back -
how can convert human readable string bytearray , back?
say have "hello world" , want bytearray , bytearray same string?
you can use bytearray()
:
b_array = bytearray('yoyo') elem in b_array: print elem
to convert b_array
string format use .decode()
:
for elem in b_array.decode(): print elem
Comments
Post a Comment