(24)Python实现递归生成或者删除一个文件目录及文件
2024-09-05 13:56:25
- def removeDir(dirPath):
- '''
- Created by Wu Yongcong 2017-8-18
- :param dirPath:
- :return:
- '''
- if not os.path.exists(dirPath):
- raise FileException("input error!not exist dirPath")
- else:
- shutil.rmtree(dirPath)
- def mkdirPath(dirPath):
- '''
- :param dirPath:
- :return:
- Created by Wu Yongcong 2017-8-18
- 递归创建输入的路径下面的文件夹或文件
- '''
- if os.path.exists(dirPath):
- raise FileException("input error!the dirPath is exist")
- else:
- os.makedirs(dirPath)
最新文章
- android_demo之生成颜色布局
- dede去掉当前位置position后面的箭头
- Servlet Threading Model
- windows下 tomcat7 配置成服务
- hdu 5392 Infoplane in Tina Town(数学)
- 51操作各种demo 驱动
- VS关闭Browser Link
- 分享到QQ空间、新浪微博、腾讯微博和人人网
- iOS多线程——GCD与NSOperation总结
- ubuntu14.04上实现faster rcnn_TF的demo程序及训练过程
- 【Docker】基础学习及在.Net Core应用
- PyInstaller安装使用方法
- 巧用string中的contains巧解一道题目
- wqCms6.0在IIS6的Getshell
- 《剑指offer》第五十九题(队列的最大值)
- Linux内核学习笔记二——进程
- 论Ubuntu下的docker多难搭建
- PL/SQL Developer 导出csv文件,用excel打开中文显示乱码
- 29. What Makes a True Leader ? 合格的领导者由何物决定 ?
- poj3624 Charm Bracelet
热门文章
- python控制流-名词解释
- 红帽学习笔记[RHCSA] 第七课[网络配置相关]
- linux最强编辑神器vim常用命令大全:编辑、插入、删除、替换、保存...
- linux上执行mysql的脚本文件
- C++代码审查
- [多校联考2019(Round 5 T2)]蓝精灵的请求(二分图染色+背包)
- if练习
- HNUSTOJ-1253 Babelfish(字典树)
- [pwnable.kr] - wtf
- 剑指offer-顺序打印二叉树节点(系列)-树-python