#Filename: file_read_and_write.py #打开文件,cNames读取所有行,储存在列表中,循环对每一行在起始处加上序号1,2,3,4 with open(r'file/companies.txt') as f1: cNames = f1.readlines() for i in range(0,len(cNames)): cNames[i] = str(i+1) + '.' + '' + cNames[i] #将处理过的cNames写入新的文件中 with open(…