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')