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 98 views
3 answers 350 views
3 answers 262 views
262 views asked Sep 15, 2020 by avibootz
1 answer 280 views
2 answers 153 views
1 answer 204 views
...