python 生成、删除、拷贝目录
Python 删除 生成 目录 拷贝
2023-09-27 14:25:21 时间
1. 生成目录
函数原型:distutils.dir_util.mkpath(name[, mode=0777, verbose=0, dry_run=0])
from distutils import dir_util dir_util.mkpath("new_dir")
2. 删除目录
函数原型:distutils.dir_util.remove_tree(directory[, verbose=0, dry_run=0])
from distutils import dir_util dir_util.remove_tree(del_dir)
3. 拷贝目录
函数原型:distutils.dir_util.copy_tree(src, dst[, preserve_mode=1, preserve_times=1, preserve_symlinks=0, update=0, verbose=0, dry_run=0])
from distutils import dir_util dir_util.copy_tree("del", "del_copy")
相关文章
- Python递归遍历目录并删除文件中的前N行
- Shell离线升级脚本(Python专用)
- 【华为OD机试真题 python】最大利润【2022 Q4 | 100分】
- 51 python - 多继承
- 40 python - 文件重命名、删除
- python 编码规范整理
- AttributeError: ‘str‘ object has no attribute ‘leaves‘.python提取三元组报错
- 【Python】删除字符串首尾的空字符 空格 回车 换行等
- python 遍历list并删除部分元素
- OpenCV+yolov3实现目标检测(C++,Python)
- Python 实现希尔排序(缩小增量排序)算法
- 使用 Python 从作为字符串给出的数字中删除前导零
- 9、链表——从尾到头打印链表(python版)
- Python实例---基于页面的后台管理[简单版]
- python 删除postgres表有上下级时注意事项
- python mysql 查询更新删除
- Python当中list列表的使用(创建列表,删除列表元素,添加列表元素,插入列表元素)
- Python删除列表中的空格
- python五十八课——正则表达式(分组)
- Python重命名和删除文件
- Python 递归删除指定文件夹