def prettyBytes(b):
    """
    Pretty-print bytes
    """
    prefixes = ['B', 'KiB', 'MiB', 'GiB', 'TiB']
    while b >= 1024 and len(prefixes) > 1:
        b /= 1024
        prefixes.pop(0)
    return f'{b:.1f} {prefixes[0]}'
