Popular recipes by Doug Latornell http://code.activestate.com/recipes/users/4173209/2010-03-05T17:18:13-08:00ActiveState Code RecipesHumanized representation of a number of bytes (Python)
2010-03-05T17:18:13-08:00Doug Latornellhttp://code.activestate.com/recipes/users/4173209/http://code.activestate.com/recipes/577081-humanized-representation-of-a-number-of-bytes/
<p style="color: grey">
Python
recipe 577081
by <a href="/recipes/users/4173209/">Doug Latornell</a>
(<a href="/recipes/tags/bytes/">bytes</a>, <a href="/recipes/tags/humanize/">humanize</a>).
Revision 2.
</p>
<p>Convert an integer number of bytes to a string representation. Example: 1024 -> 1 kB</p>
<p>Based quite heavily on <a href="http://mail.python.org/pipermail/python-list/2008-August/1171178.html">http://mail.python.org/pipermail/python-list/2008-August/1171178.html</a></p>