1 # ------多行写入------ 2 nums = ['one','two','three','four','five','six','seven'] 3 t = open(r'd:python_fileprocess 2.txt','a') 4 for get_one in nums: 5 t.write(get_one+' ') 6 t.close() 7 print('连续写入完成!')
1 # ------多行写入------ 2 nums = ['one','two','three','four','five','six','seven'] 3 t = open(r'd:python_fileprocess 2.txt','a') 4 for get_one in nums: 5 t.write(get_one+' ') 6 t.close() 7 print('连续写入完成!')