Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pretty size python

def human_size(bytes, units=[' bytes','KB','MB','GB','TB', 'PB', 'EB']):
    return str(bytes) + units[0] if bytes < 1024 else human_size(bytes>>10, units[1:])
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pretty #size #python
ADD COMMENT
Topic
Name
7+1 =