w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to copy all files from a folder (including sub-folder) while not copying the folder structure in python
import os
import shutil

for root, dirs, files in os.walk('.'):  # replace the . with your starting
directory
   for file in files:
      path_file = os.path.join(root,file)
      shutil.copy2(path_file,'destination_directory') # change you
destination dir




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.