I am using joblib to run an script in parallel.
joblib
The function func use a C++ code wrapped with swig and the number of threads is
func
swig