Python:按行读取文件内容,排序后输出 2015-06-17 10884 Python 排序 0 很silly的程序,备份用,临时拿来用挺方便的a = [] with open('A.txt', 'r') as f: for line in f: a.append(line.strip()) for item in sorted(a): print(item)