UNIX-style sort in Python?

Andrew Dalke adalke at mindspring.com
Mon Oct 18 13:09:03 EDT 2004


Alex Martelli wrote:
> Wrong syntax -- needs to be:
> 
> lines = [(get_fields(line), line) for line in open("imputfilename")]

Bah!  I all too often forget that () on the LHS of the list
comprehension.  :(

				Andrew
				dalke at dalkescientific.com



More information about the Python-list mailing list