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 183 views
3 answers 544 views
3 answers 404 views
404 views asked Sep 15, 2020 by avibootz
1 answer 362 views
2 answers 250 views
1 answer 289 views
...