urls = open('variables.txt', 'r')
lines = urls.readlines() # read all the lines of txt
urls.close()
for index, line in enumerate(lines): # iterate over each line
if index == 1:
line_split = line.split(';')
line = line_split[0] + '2;
'
if index == 2:
line_split = line.split(';')
line = line_split[0] + '3;
'
lines[index] = line
with open('variables.txt', 'w') as urls:
urls.writelines(lines) # save all the lines
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…