def argv_to_str(command_argv, quote=True):
 map_func = (shlex_quote if quote else (lambda x: x))
 return ' '.join([map_func(c) for c in command_argv if (c is not None)])

def argv_to_str ( command_argv , quote = True ) : map_func = ( shlex_quote if quote else ( lambda x : x ) ) return ' ' . join ( [ map_func ( c ) for c in command_argv if ( c is not None ) ] )
convert an argv command list to a string for shell subprocess .