Created
November 29, 2016 05:10
-
-
Save sighingnow/d22bb83fc1a8b1d5a6126e77e1977ec9 to your computer and use it in GitHub Desktop.
Get CPU number on Windows platform.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
def get_cpu_number(): | |
''' Return the processors' number, an integer value. | |
''' | |
import os | |
return int(os.environ['NUMBER_OF_PROCESSORS']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment