exceptions from logging on Windows

2005-09-12 Thread Oliver Eichler
Hi, I experience several exceptions from python's logging system when using the rollover feature on Windows. Traceback (most recent call last): File "c:\Python24\lib\logging\handlers.py", line 62, in emit if self.shouldRollover(record): File "c:\Python24\lib\logging\handlers.py", line 132

Re: convert list of tuples into several lists

2005-02-10 Thread Oliver Eichler
Pierre Barbier de Reuille wrote: > > Best answer is : try it :) > use the "timeit" module (in the standard lib) to do so ... Ok, (a second time. I hope the first post was cancelled as it was false) import timeit s = """\ a,b,c1,c2 = zip(*[(x[2],x[4], x[2]-x[1], x[2] - x[3]) for x in z]) """ t

Re: convert list of tuples into several lists

2005-02-10 Thread Oliver Eichler
Pierre Barbier de Reuille wrote: > Best answer is : try it :) > use the "timeit" module (in the standard lib) to do so ... Ok, import timeit s = """\ a,b,c1,c2 = zip(*[(x[2],x[4], x[2]-x[1], x[2] - x[3]) for x in z]) """ t = timeit.Timer(stmt=s,setup="z = [(1,2,3,4,5)]*1000") print "%.2f usec/p

Re: convert list of tuples into several lists

2005-02-09 Thread Oliver Eichler
Diez B. Roggisch wrote: > zip(*[(1,4),(2,5),(3,6)]) > Thanks :) I knew it must be simple. The asterics - thing was new to me. By the way: What is faster? this: z = [(1,4),(2,5),(3,6) a,b = zip(*[(x[0], x[0]-x[1]) for x in z]) or: a = [] b = [] for x in z: a.append(x[0]) b.append(x[0]-x[

convert list of tuples into several lists

2005-02-09 Thread Oliver Eichler
Hi, I can find examples to convert lists into a list of tuples like: >>> map(None,[1,2,3],[4,5,6]) [(1,4),(2,5),(3,6)] but how is it done vice versa? Oliver -- http://mail.python.org/mailman/listinfo/python-list

get list of member variables from list of class

2005-01-28 Thread Oliver Eichler
Hi what will be the fastest solution to following problem class a: def __init__(self): self.varA = 0 self.varB = 0 s.o. ... listA = [a]*10 varA = [] varB = [] for l in listA: varA.append(l.varA) varB.append(l.varB) s.o. ... I could think of: [varA.append(l.varA) fo