import cpuinfo
print('CPU =', cpuinfo.get_cpu_info()['brand_raw'])
1
import os
2
workers = os.cpu_count()
3
if 'sched_getaffinity' in dir(os):
4
workers = len(os.sched_getaffinity(0))
5
$ pip install memory_profiler
$ pip install line_profiler