Last active
June 19, 2019 19:48
-
-
Save shamilnabiyev/fc40dfa7b0857b6b1267f607dd6cbb41 to your computer and use it in GitHub Desktop.
Move files and folder to another destination in python
This file contains hidden or 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
new_dst = "new_dst_folder/" | |
for folder in os.listdir(basedir): | |
inner_path = basedir + folder + "/" | |
for file in os.listdir(inner_path): | |
shutil.move(os.path.join(inner_path, file), new_dst) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment