import os

for here, dirs, files in os.walk(startdir, topdown=True):
    dirs[:] = []    

注意:dirs[:] = [] 不能改为 dirs = []

相关文章:

  • 2022-12-23
  • 2022-01-10
  • 2021-12-24
  • 2022-12-23
  • 2021-08-21
猜你喜欢
  • 2022-12-23
  • 2021-08-31
  • 2022-12-23
  • 2022-12-23
  • 2021-06-12
  • 2021-11-04
相关资源
相似解决方案