1. 首页
  2. 大数据
  3. Netty
  4. python 两种方法删除空文件夹

python 两种方法删除空文件夹

上传者: 2020-12-17 08:38:42上传 PDF文件 39.26KB 热度 15次
第一种方法: import os def delete_gap_dir(dir): if os.path.isdir(dir): for d in os.listdir(dir): #print('1',os.path.join(dir, d)) path = os.path.join(dir, d) if os.path.isdir(path) and not path.endswith('pic_neg'): delete_gap_dir(path) if not os.listdir(dir): #pr
下载地址
用户评论