1import psutil # Can be found at https://pypi.org/project/psutil/
2
3psutil.virtual_memory()
1#!/usr/bin/env python
2import psutil
3# gives a single float value
4psutil.cpu_percent()
5# gives an object with many fields
6psutil.virtual_memory()
7# you can convert that object to a dictionary
8dict(psutil.virtual_memory()._asdict())