pythonglob和loop的用法?
找到目錄中的文件(或目錄)名,判斷其是不是目錄,如果是目錄再遍歷子目錄。你說的loop應該是循環的意思。import osimport globd = u'd:\\7-zip\\'def loop(path): files = glob.glob1(path, '*') print files for file in files: if os.path.isdir(os.path.join(path, file)): loop(os.path.join(path, file)) loop(d)