#NEWLINE# def ShellEscapeList( words ) : #NEWLINE# #INDENT# 'Turn a list of words into a shell-safe string.\n\n  Args:\n    words: A list of words, e.g. for a command.\n\n  Returns:\n    A string of shell-quoted and space-separated words.\n  ' #NEWLINE# if win32 : #NEWLINE# #INDENT# return ' ' . join ( words ) #NEWLINE# #UNINDENT# s = '' #NEWLINE# for word in words : #NEWLINE# #INDENT# s += ( ( "'" + word . replace ( "'" , '\'"\'"\'' ) ) + "' " ) #NEWLINE# #UNINDENT# return s [ : ( - 1 ) ]