>>> param = {'LIBS': 'lala', 'DATE': '20120405', 'INPUT': 'input_file'} >>> reduce(tuple.__add__, zip(['-d']*len(param), ('%s=%s'%(k, param[k]) for k in param))) ('-d', 'LIBS=lala', '-d', 'DATE=20120405', '-d', 'INPUT=input_file') >>>