python 递归迭代目录
from pathlib import Path
def openfile(path:str)->None:
yield path
def cix(path:str):
p=Path(path)
if p.exists():
if p.is_file():
yield from openfile(str(p))
elif p.is_dir():
for item in p.iterdir():
if item.is_file():
yield from openfile(str(item))
elif item.is_dir():
yield from cix(str(item))
for b in cix("d:/wamp"):

浙公网安备 33010602011771号