Skip to content

Instantly share code, notes, and snippets.

View SilentGlasses's full-sized avatar
🏠
Working from home

SilentGlasses SilentGlasses

🏠
Working from home
View GitHub Profile
import os
import matplotlib.pyplot as plt
def get_size_format(b, factor=1024, suffix="B"):
"""
Scale bytes to its proper byte format
e.g:
1253656 => '1.20MB'
1253656678 => '1.17GB'