In Java, this will return the number of available processors:
Runtime.getRuntime().availableProcessors()
This is handy when deciding how many long running threads to create.
Is there an equivalent function to call in Python?
In Java, this will return the number of available processors:
Runtime.getRuntime().availableProcessors()
This is handy when deciding how many long running threads to create.
Is there an equivalent function to call in Python?
Here you go, there are definitely duplicate answers out there
import os
os.cpu_count()