Skip to content

Instantly share code, notes, and snippets.

@kitusmark
Created December 15, 2015 17:22
Show Gist options
  • Save kitusmark/31c9b6dcd90d1fa0c5ab to your computer and use it in GitHub Desktop.
Save kitusmark/31c9b6dcd90d1fa0c5ab to your computer and use it in GitHub Desktop.
If statement for applications for windows, linux and Mac
if sys.platform.startswith('win'):
#Code for windows based
elif sys.platform.startswith('linux') or sys.platform.startswith('cygwin'):
#Code for linux based systems
elif sys.platform.startswith('darwin'):
#code for Mac Machines
else:
raise EnvironmentError('Unsupported platform')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment