Skip to content

Instantly share code, notes, and snippets.

@2600box
Last active July 31, 2022 20:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 2600box/4c07bc2885fe5fdbfa8fdd66ae0f9d7d to your computer and use it in GitHub Desktop.
Save 2600box/4c07bc2885fe5fdbfa8fdd66ae0f9d7d to your computer and use it in GitHub Desktop.
Python
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