#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys
import psutil


def get_cpu_load():
    load = psutil.cpu_percent(interval=1)
    return "%s%%" % load


def get_memory_percent():
    mem = psutil.virtual_memory()
    return "%s%%" % mem.percent


def main():
    try:
        print(" %5s %4s" % (get_cpu_load(), get_memory_percent()))
    except:
        sys.exit(
            "psutil not found please install with pip install psutil")

if __name__ == '__main__':
    main()

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys
import psutil


def get_cpu_load():
    return psutil.cpu_percent(interval=1)


def get_mem_load():
    mem = psutil.virtual_memory()
    return mem.percent


def main():
    try:
        print(" %5s%% %4s%%" % (get_cpu_load(), get_mem_load()))
    except:
        sys.exit("psutil not found, please install it (pip install psutil)")

if __name__ == '__main__':
    main()

make script python3