Skip to content

Instantly share code, notes, and snippets.

View zeandrade's full-sized avatar
🏠
At Home

Zé Roberto Andrade Jr. zeandrade

🏠
At Home
  • home
  • Curitiba, Brasil
View GitHub Profile
@zeandrade
zeandrade / size.py
Last active July 4, 2018 15:14 — forked from cbwar/size.py
Python: Human readable file size
def sizeof_fmt(num, iec=True):
"""Readable file size
:param num: Bytes value
:type num: int
:param iec: default True, set iec pattern (powers of 1024),
False set si pattern (powers of 1000)
:type iec: boolean
:rtype: str
"""