1
Suppose I convert some image to bytearray
.
with open("img.png", "rb") as imageFile:
f = imageFile.read()
b = bytearray(f)
print b[0]
How do I know how much disk space this bytearray
will take over if I decide to save you.
1
Suppose I convert some image to bytearray
.
with open("img.png", "rb") as imageFile:
f = imageFile.read()
b = bytearray(f)
print b[0]
How do I know how much disk space this bytearray
will take over if I decide to save you.
Browser other questions tagged python python-3.x
You are not signed in. Login or sign up in order to post.
I thought that
len()
would return the number of entries.– Matheus Saraiva
@Exact Matheussaraiva, but if it’s a byte array, the number of elements will be the number of bytes, agree?
– Woss
True, but I thought
bytearray
in that case it would have more than one byte per position.– Matheus Saraiva