当前位置: 移动技术网 > IT编程>脚本编程>Python > python实现写数字文件名的递增保存文件方法

python实现写数字文件名的递增保存文件方法

2018年11月05日  | 移动技术网IT编程  | 我要评论

吕文斯基,三星液晶电视怎么样,啦酷酷影视

如下所示:

 col = []
 img = "test1"
 img1 = "test2"
 col.append(img)
 col.append(img1)
 data=np.array(col)
 np.savetxt('/public/home/student6/test/test.csv',data,fmt='%s')
 col=[]
 img2 = "test3"
 img3 = "test4"
 col.append(img2)
 col.append(img3)
 data=np.array(col)
 i = 1 
 np.savetxt('/public/home/student6/test/test'+'%d.csv'%i ,data,fmt='%s')

最主要就是如下代码段的写法

np.savetxt('/public/home/student6/test/test'+'%d.csv'%i ,data,fmt='%s')

以上这篇python实现写数字文件名的递增保存文件方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持移动技术网。

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网