Technical

2018-04-26 Use glob to filter fo

2018-04-26  本文已影响0人  猪迹

Usage

Code snap to filter under a path

    import glob
    import os
    
    target_folder = "xxxxx"
    arr_dir = []
    if os.path.exists(target_folder):
      for sub_file in glob.glob(target_folder + "/*"):
        if os.path.isdir(sub_file):
          arr_dir.append(sub_file)

References

上一篇下一篇

猜你喜欢

热点阅读