import os
def save_txt(list1, list2, save_path):
if os.path.isfile(save_path):
os.remove(save_path)
with open(save_path, "a") as f:
for i in range(len(list1)):
f.write('{:}:{:}\n'.format(list1[i], list2[i]))
f.close()
if __name__ == '__main__':
list1 = ['1-0', '2-0', '3-0']
list2 = [10, 20, 30]
save_path = "E:/test_list.txt"
save_txt(list1, list2, save_path)
结果如图: