getplatform#
- getplatform(expected=None, platform=None, die=False)[source]#
Return the name of the current “main” platform (e.g. ‘mac’)
Alias to
sys.platform
, except maps entries onto one of ‘linux’, ‘windows’, ‘mac’, or ‘other’.- Parameters:
- Returns:
‘linux’, ‘windows’, ‘mac’, or ‘other’
- Return type:
String, one of
Examples:
sc.getplatform() # Get current name of platform sc.getplatform('windows', die=True) # Raise an exception if not on Windows sc.getplatform(platform='darwin') # Normalize to 'mac'