A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2005-September/296410.html below:

sorting tuples...

sorting tuples... sorting tuples...bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Sat Sep 17 09:50:56 EDT 2005
Uhm, if the file is clean you can use something like this:

data = """\
200501221530
John
*** long string here ***

200504151625
Clyde
*** clyde's long string here ***

200503130935
Jeremy
*** jeremy string here ****"""

records = [rec.split("\n") for rec in data.split("\n\n")]
records.sort()
print records

If it's not clean, you have to put some more cheeks/cleanings.

Bye,
bearophile


More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4