import sys
import platform
import os
from subprocess import *
if len(sys.argv) != 2:
print("arg error, " + sys.argv[0] + " input_file");
exit(1)
input_file = sys.argv[1];
fp = open(input_file,"r+");
linesText = fp.readlines();
linesText.sort();
for line in linesText:
print(line);
fp.seek(0)
fp.writelines(linesText)
fp.close();
print("finish");
python之简单排序文本文件
最新推荐文章于 2024-09-19 20:23:28 发布