Scott David Daniels wrote: > A little better: > > f = open("test.dat") > for line in f: > printLine = line.rstrip("\n") > if printLine: > print printLine
[sys.stdout.write(line) for line in open('test.dat') if line.rstrip('\n')] Where's my prize? What do you mean, shorter isn't always better? ;) -- http://mail.python.org/mailman/listinfo/python-list