【发布时间】:2020-06-07 16:43:25
【问题描述】:
我想重命名一个 mp3 文件。
os.rename(f'C:\\Users\\axeld\\Desktop\\Music\\NG Trial\\{item}',
f'C:\\Users\\axeld\\Desktop\\Music\\NG Trial\\{Song_name}')
但我收到此错误:
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'C:\\Users\\axeld\\Desktop\\Music\\NG Trial\\109650.mp3' -> 'C:\\Users\\axeld\\Desktop\\Music\\NG Trial\\Operation: Evolution.mp3'
我 100% 确定文件存在,为什么会出现此错误?
【问题讨论】:
-
尝试使用
/而不是\\