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

Popular posts from this blog

java - Could not locate OpenAL library -

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

sorting - opencl Bitonic sort with 64 bits keys -