how to get CPU usage by python code example
Example 1: python get cpu info
import cpuinfo
print('CPU =', cpuinfo.get_cpu_info()['brand_raw'])
Example 2: how to measure how much your of cpu your program is using in python
$ pip install memory_profiler