How to initialize array with a sequence of bytes in Python

1 Answer

0 votes
import array     

s = b'Python'   
a = array.array('b', s)     

print(s)     
print(a)     




'''
run:
 
b'Python'
array('b', [80, 121, 116, 104, 111, 110])

'''

 



answered May 11, 2019 by avibootz

Related questions

...