1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
def paixu(list_line):
list_line.sort()
return list_line


if __name__ == '__main__':
list_line = []
with open("./1.txt", "r") as f:
for line in f:
if len(line)>10:
print(line[4:])
line= line[4:]
list_line.append(line.strip())
list_line =paixu(list_line)
print(list_line)
with open("2.txt","w") as f:
for line in list_line:
f.write(line)
f.write("\n\n")

image-20220718103419830

可以把这样的格式,变成那样的格式,根据作者首字母排序

image-20220718103351716