def pipe(*args):
 if (len(args) < 2):
  raise ValueError('pipe needs at least 2 processes')
 for i in args[:(-1)]:
  i['stdout'] = subprocess.PIPE
 popens = [popen_sp(**args[0])]
 for i in range(1, len(args)):
  args[i]['stdin'] = popens[(i - 1)].stdout
  popens.append(popen_sp(**args[i]))
  popens[(i - 1)].stdout.close()
 return popens

def pipe ( * args ) : if ( len ( args ) < 2 ) : raise ValueError ( 'pipe needs at least 2 processes' ) for i in args [ : ( - 1 ) ] : i [ 'stdout' ] = subprocess . PIPE popens = [ popen_sp ( ** args [ 0 ] ) ] for i in range ( 1 , len ( args ) ) : args [ i ] [ 'stdin' ] = popens [ ( i - 1 ) ] . stdout popens . append ( popen_sp ( ** args [ i ] ) ) popens [ ( i - 1 ) ] . stdout . close ( ) return popens
takes as parameters several dicts .