Created
November 2, 2021 05:53
-
-
Save Rahulsharma0810/e55a2d0a4907ac86b2a2f9b2a19c1e77 to your computer and use it in GitHub Desktop.
move-files-subdir-to-maindir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import shutil | |
import os | |
SOURCE= r'PATHA' | |
DESTINATION = r'PATHB' | |
for path, subdirs, files in os.walk(SOURCE): | |
for name in files: | |
filename = os.path.join(path, name) | |
print(filename) | |
shutil.copy2(filename, DESTINATION) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment