def protect_filename(s):
 if (set(s) & set(PROTECTABLES)):
  if (sys.platform == 'win32'):
   return (('"' + s) + '"')
  else:
   return ''.join(((('\\' + c) if (c in PROTECTABLES) else c) for c in s))
 else:
  return s

def protect_filename ( s ) : if ( set ( s ) & set ( PROTECTABLES ) ) : if ( sys . platform == 'win32' ) : return ( ( '"' + s ) + '"' ) else : return '' . join ( ( ( ( '\\' + c ) if ( c in PROTECTABLES ) else c ) for c in s ) ) else : return s
escape a string to protect certain characters .