Reputation: 313
I was wondering if there was a platform independent way of getting system information for linux, windows, mac. I know you can use platform module to get some basic information. I am looking for more detailed information like
Upvotes: 1
Views: 1169
Reputation: 11381
I recommend using psutil
library for this. Not everything you require is available, but it's a good place to start. For example, to get the CPU count, you can use the following code.
>>> import psutil
>>> psutil.cpu_count() # Logical core
4
>>> psutil.cpu_count(logical=False) # Physical core
2
Upvotes: 1