Skip to content

Instantly share code, notes, and snippets.

@krisarmstrong
Created April 1, 2015 15:46
Show Gist options
  • Select an option

  • Save krisarmstrong/a6fff0d44b174376350b to your computer and use it in GitHub Desktop.

Select an option

Save krisarmstrong/a6fff0d44b174376350b to your computer and use it in GitHub Desktop.
Checks for system OS (Linux, Windows, MAC OSX)
system_os = sys.platform
if sys.platform.startswith('win32'):
# Win32-specific code here...
print("DEBUG: Windows Version", system_os)
elif sys.platform.startswith('linux'):
# Linux-specific code here...
print("DEBUG: Linux Version", system_os)
elif sys.platform.startswith("darwin"):
# OSX-specific code here...
print("DEBUG: Mac OSX Version", system_os)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment