temp=[12,45,78]
i=1
while True:
if i==1:
w=open('data_base.txt','+')
te=str(temp[0])+' '+str(temp[1])+' '+str(temp[2])+'\n'
w.write('\n'+te+'\n')
w.write('\n')
w.write('\n'+te+'\n')
w.write('\n')
w.write('\n'+te+'\n')
w.write('\n')
w.close()
i=0
print('运行结束了')

https://python3-cookbook.readthedocs.io/zh_CN/latest/c05/p01_read_write_text_data.html
at模式