Jul-11-2021, 03:07 PM
(Jul-11-2021, 01:39 PM)korenron Wrote: how can I get the all files in a spesific folder (include sub-folder)?Then need a recursive solution with pathlib it will be like this.
from pathlib import Path dest = r'C:\Test' for path in Path(dest).rglob('*'): if path.is_file(): print(path)With OS module the same would be.
import os dest = r'C:\Test' for root,dirs,files in os.walk(dest): for file in files: print(os.path.join(root, file))