⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 find.py

📁 minimal python variant for small footprint apps like embedded apps
💻 PY
字号:
import fnmatchimport os_debug = 0_prune = ['(*)']def find(pattern, dir = os.curdir):	list = []	names = os.listdir(dir)	names.sort()	for name in names:		if name in (os.curdir, os.pardir):			continue		fullname = os.path.join(dir, name)		if fnmatch.fnmatch(name, pattern):			list.append(fullname)		if os.path.isdir(fullname) and not os.path.islink(fullname):			for p in _prune:				if fnmatch.fnmatch(name, p):					if _debug: print "skip", `fullname`					break			else:				if _debug: print "descend into", `fullname`				list = list + find(pattern, fullname)	return list

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -