Skip to content

Instantly share code, notes, and snippets.

@zDEFz
zDEFz / iomemdec.py
Created December 28, 2022 20:22 — forked from paulguy/iomemdec.py
Script to output /proc/iomem size
#!/usr/bin/env python
import sys
SUFFIXES = ('', 'KiB', 'MiB', 'GiB', 'TiB')
def decode(filename, human=False):
with open(filename, 'r') as infile:
for line in infile:
line = line[:-1]