【Python】删除和拷贝文件

来源:互联网 发布:淘宝卖家账号出售价格 编辑:程序博客网 时间:2024/05/29 06:55
>>> import os
>>> help(os.remove)
Help on built-in function remove in module nt:


remove(...)
    remove(path, *, dir_fd=None)
    
    Remove a file (same as unlink()).
    
    If dir_fd is not None, it should be a file descriptor open to a directory,
      and path should be relative; path will then be relative to that directory.
    dir_fd may not be implemented on your platform.
      If it is unavailable, using it will raise a NotImplementedError.


>>> help(os.unlink)
Help on built-in function unlink in module nt:


unlink(...)
    unlink(path, *, dir_fd=None)
    
    Remove a file (same as remove()).
    
    If dir_fd is not None, it should be a file descriptor open to a directory,
      and path should be relative; path will then be relative to that directory.
    dir_fd may not be implemented on your platform.
      If it is unavailable, using it will raise a NotImplementedError.


>>> import shutil
>>> help(shutil.copyfile)
Help on function copyfile in module shutil:


copyfile(src, dst, *, follow_symlinks=True)
    Copy data from src to dst.
    
    If follow_symlinks is not set and src is a symbolic link, a new
    symlink will be created instead of copying the file it points to.
0 0
原创粉丝点击