我在寫一個快速腳本這將改變每名擅長位於一個目錄下的文件:重命名Excel文件os.rename()的Python
[...]
for file_ in os.listdir(path):
if 'Analytics Android' in file_:
os.rename(file_, 'Android Orders.xlsx')
但是,我得到一個錯誤:[Error 2] The system cannot find the file specified.
不該」 t rename
函數將名稱更改爲第二個參數?
你給功能的錯誤路徑。這就是錯誤的含義。 – sashoalm
你的下一個問題是你試圖給所有的新文件命名。 – tdelaney