arrs=[2,15,48,4,5,6,7,6,4,1,2,3,6,6,7,4,6,8]
f=open('test.txt','w+')
count=0
for temp in arrs:
count+=1
print >> f,temp,
if(count%3==0):
print >> f
f.close()
结果:
arrs=[2,15,48,4,5,6,7,6,4,1,2,3,6,6,7,4,6,8]
f=open('test.txt','w+')
count=0
for temp in arrs:
count+=1
print >> f,temp,
if(count%3==0):
print >> f
f.close()
结果: