def SplitIntoComponents(str_in):
 if str_in.startswith(('"', "'")):
  return shlex.split(str_in)
 else:
  components = str_in.split(' ', 1)
  if (len(components) > 1):
   return ([components[0]] + SplitIntoComponents(components[1]))
  else:
   return components

def SplitIntoComponents ( str_in ) : if str_in . startswith ( ( '"' , "'" ) ) : return shlex . split ( str_in ) else : components = str_in . split ( ' ' , 1 ) if ( len ( components ) > 1 ) : return ( [ components [ 0 ] ] + SplitIntoComponents ( components [ 1 ] ) ) else : return components
splits strings into space-separated components .