Spaces:
Running
Running
File size: 293 Bytes
b00d2c6 |
1 2 3 4 5 |
#Thanks @DeletedFromEarth for helping in this journey
def human_size(bytes, units=[' bytes','KB','MB','GB','TB', 'PB', 'EB']):
""" Returns a human readable string representation of bytes """
return str(bytes) + units[0] if int(bytes) < 1024 else human_size(int(bytes)>>10, units[1:])
|