對於我的循環來實現的,我需要給作爲文件的名稱「我的迭代次數」,例如,我們的目標是節省:如何給文件命名?
my first iteration in the first file.
my second iteration in the second file.
....
我使用該庫numpy,但我的代碼並沒有給我我需要的解決方案,事實上我的實際代碼迫使我在每次迭代之後輸入文件的名稱,這很容易,如果我有6或7次迭代,但我在如果我有100次迭代,這是沒有意義的:
for line, a in enumerate(Plaintxt_file):
#instruction
#result
fileName = raw_input()
if(fileName!='end'):
fileName = r'C:\\Users\\My_resul\\Win_My_Scripts\\'+fileName
np.save(fileName+'.npy',Result)
ser.close()
如果你能幫助我,我將不勝感激。
你的文件名是否有順序給他們? – ANVGJSENGRDG