-
目录过滤python脚本
-
- import sys,os,os.path
- import pdb
-
- def getsubdocs(path=None):
- doclist = []
- if(os.path.isdir(path)):
- for item in os.listdir(path):
- if item != '.svn':
- if os.path.isdir(path+os.sep+item):
- doclist.append(item)
- return doclist
-
-
- def getallsubdocs(path=None):
-
- doclist = []
- if(os.path.isdir(path)):
- if len(os.listdir(path)) > 0:
- for item in os.listdir(path):
- if item != '.svn':
- doclist.extend(getallsubdocs(path+os.sep+item))
- else:
- doclist.append(path)
- return doclist
-
- def getalldocs(path=None):
- doclist = []
- for root,dirs,files in os.walk(path):
- if root.find('.svn') < 0:
- doclist.append(root)
- return doclist
- if __name__=='__main__':
- path = raw_input('Enter root path(/*/*/....): ')
- doclist = getallsubdocs(path)
- print doclist
-
相关阅读:
大厂Redis高并发场景设计,面试问的都在这!
POJ1006——中国剩余定理
HDU3501——欧拉函数裸题
堆-动态的排序(洛谷1801-黑匣子)
图中欧拉回路数量
ip地址
网络通信概述
网络通信概述
软件安装与卸载
软件安装与卸载
-
原文地址:https://www.cnblogs.com/SophiaTang/p/2291167.html
Copyright © 2020-2023
润新知