1

I need to get the amount of physical CPU cores with Python.

My CPU has 4 cores and 8 threads. I know a couple of functions like os.cpu_count and multiprocessing.cpu_count, but they return 8 which is the amount of threads, not cores. How can I get the amount of cores, not threads? Is there any function in Python for that?

Kaiyakha
  • 1,463
  • 1
  • 6
  • 19

0 Answers0