
Aug. 27, 2008
6:21 p.m.
2008/8/27 Tarek Ziadé <ziade.tarek@gmail.com>:
[l.strip() as stripped for l in text.split('\n') if stripped != '']
Two linkes are better than one: stripped = [l.strip() for l in text.split('\n')] [l for l in stripped if l != ''] You are performing two different operations on the list after all. And more readable. -- mvh Björn