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')