The Python standard library provides multiple APIs to get this info, but none are sufficient. Even worse, because of CPU features like instruction-level parallelism and simultaneous threading (aka Hyper-threading on Intel CPUs), the number of cores you can effectively use depends on the code you have written!
If you read the Python standard library documentation, it has a os.cpu_count() function that returns "the number of logical CPUs in the system". What does logical mean? We'll get to that in a bit.
[
add
]
[
|
|
...
]