[pyar] Duda sobre list comprehensions

Ricardo Aráoz ricaraoz en gmail.com
Dom Sep 30 13:26:02 ART 2012


 >>> 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')
 >>>




More information about the pyar mailing list