python os.rename - 文件重命名

创建日期: 2022-10-17 14:59 | 作者: 风波 | 浏览次数: 15 | 分类: Python

重命名文件或者目录:

os.rename(src, dst)

Help

rename(src, dst, *, src_dir_fd=None, dst_dir_fd=None)
    Rename a file or directory.

    If either src_dir_fd or dst_dir_fd is not None, it should be a file
      descriptor open to a directory, and the respective path string (src or dst)
      should be relative; the path will then be relative to that directory.
    src_dir_fd and dst_dir_fd, may not be implemented on your platform.
      If they are unavailable, using them will raise a NotImplementedError.
15 浏览
7 爬虫
0 评论