path =r"" #写入txt文件 data_file = open(path,'w') #写入一行txt文件,并且换行 data_file.writelines(data_file) data_file.write("\n")