def pretty_bytes(num):
    """
    Pretty string of bytes size
    """
    ext = {0: '', 10: 'K', 20: 'M', 30: 'G', 40: 'T', 50: 'E'}
    for pwr in sorted(ext.keys()):
        if num / 2.0**pwr < 512:
            return "{0:.3g} {1}B".format(num / 2.0**pwr, ext[pwr])
    return "{0:g} B".format(num)