Re: [exec cmd for cmd in cmds]

2006-03-08 Thread Scott David Daniels
Schüle Daniel wrote: > you are right, I didn't think about dictionaries > >>> p = "complex(1-1e-%i, 1-1e-%i)" > >>> d={} > >>> [d.update({i:eval(p % (i,i))}) for i in range(20,30)] > [None, None, None, None, None, None, None, None, None, None] > > so now the work is complete :) > > Regards >

Re: [exec cmd for cmd in cmds]

2006-03-08 Thread Schüle Daniel
[...] > If you think so :) Ususally people go for dictionaries in such cases. you are right, I didn't think about dictionaries >>> p = "complex(1-1e-%i, 1-1e-%i)" >>> d={} >>> [d.update({i:eval(p % (i,i))}) for i in range(20,30)] [None, None, None, None, None, None, None, None, None, None] s

Re: [exec cmd for cmd in cmds]

2006-03-08 Thread Diez B. Roggisch
Schüle Daniel wrote: > Hello all, > > >>> p = "z%i = complex(1-1e-%i, 1-1e-%i)" > >>> lst = [p % (i,i,i) for i in range(10, 30)] > >>> for item in lst: > ... exec item > ... > >>> > >>> p = "z%i = complex(1-1e-%i, 1-1e-%i)" > >>> lst = [p % (i,i,i) for i in range(10, 30)] > >>> [exec i