Table of Contents
Operating System
Get Number of CPUs
Set Affinity
>>> import os >>> os.cpu_count()
# run on linux import os pid = os.getpid() affinity = {1} os.sched_setaffinity(pid, affinity)
This project tries to provide many snippets of Python code that make life easier.