【问题标题】:os.rename:TypeError: Required argument 'dst' (pos 2) not foundos.rename:TypeError: 未找到必需的参数“dst”(位置 2)
【发布时间】:2017-08-09 21:08:59
【问题描述】:

我试图在 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

【问题讨论】:

    标签: python-3.x typeerror


    【解决方案1】:

    你需要这样做

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

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

    【讨论】:

      猜你喜欢
      • 2019-10-17
      • 2019-02-08
      • 2021-07-22
      • 2019-05-10
      • 2020-08-13
      • 2020-06-13
      • 2021-07-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多