Last active
July 31, 2022 20:51
-
-
Save 2600box/4c07bc2885fe5fdbfa8fdd66ae0f9d7d to your computer and use it in GitHub Desktop.
Python
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 os | |
import shutil | |
source_folder = r"E:\demos\files\reports\\" | |
destination_folder = r"E:\demos\files\account\\" | |
# fetch all files | |
for file_name in os.listdir(source_folder): | |
# construct full file path | |
source = source_folder + file_name | |
destination = destination_folder + file_name | |
# copy only files | |
if os.path.isfile(source): | |
shutil.copy(source, destination) | |
print('copied', file_name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment