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

node.js - How to mock a third-party api calls in the backend -

php - How to Access to Laravel 5 with Pingpong-Modules to a specific Module -

sql server - Sharing data between stored procedures -