Skip to content

Instantly share code, notes, and snippets.

@sighingnow
Created November 29, 2016 05:10
Show Gist options
  • Save sighingnow/d22bb83fc1a8b1d5a6126e77e1977ec9 to your computer and use it in GitHub Desktop.
Save sighingnow/d22bb83fc1a8b1d5a6126e77e1977ec9 to your computer and use it in GitHub Desktop.
Get CPU number on Windows platform.
#!/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