os.rename:TypeError:找不到必需参数'dst'(pos 2)

时间:2017-03-18 08:46:28

标签: python-3.x typeerror

我试图在python中重命名文件。我使用os.rename转到了目录,然后尝试更改歌曲名称os.rename('shokilla.mp3, new_shokilla.mp3')但是这个错误加速了我不知道 Traceback (most recent call last): File "<pyshell#23>", line 1, in <module> os.rename('shokilla.mp3, new_shokilla.mp3') TypeError: Required argument 'dst' (pos 2) not found

1 个答案:

答案 0 :(得分:0)

  

你需要这样做

os.rename("shokilla.mp3","new_shokilla.mp3")

https://www.tutorialspoint.com/python/os_rename.htm