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

3 answers 219 views
3 answers 202 views
202 views asked Sep 15, 2020 by avibootz
1 answer 237 views
2 answers 105 views
1 answer 170 views
...