How to create memoryview from a bytes object in Python

1 Answer

0 votes
mv = memoryview(b"python")

print(mv[0])
print(mv[1])
print(mv[2])

print(mv.tolist())

'''
run:

112
121
116
[112, 121, 116, 104, 111, 110]

'''

 



answered Sep 8, 2018 by avibootz

Related questions

1 answer 106 views
3 answers 370 views
3 answers 270 views
270 views asked Sep 15, 2020 by avibootz
1 answer 286 views
2 answers 160 views
1 answer 208 views
...