For finding the number of CPUs which are using Python you can simply use:-
import multiprocessing
multiprocessing.cpu_count()
Another thing you can do is use the psutil library, which always turns out useful in these situations:-
import psutil
psutil.cpu_count()
This will work on any platform supported by psutil(Unix and Windows).