Last active
August 29, 2015 14:01
-
-
Save luistung/a8b1e2f62703d9352607 to your computer and use it in GitHub Desktop.
文件排序
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
lines = [] | |
for line in sys.stdin: | |
line = line.rstrip() | |
tokens = line.split('\t') | |
src, tgt = tokens[0], tokens[1] | |
lines.append(((src,tgt), line)) #TODO | |
lines.sort(key=lambda a:a[0]) | |
for _, line in lines: | |
print line |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment