Answers for "pretty size python"

0

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:])
Posted by: Guest on June-20-2021

Python Answers by Framework

Browse Popular Code Answers by Language