Answers for "how to move all html files from one directory to other using python"

0

how to move all html files from one directory to other using python

import shutil
import os
    
source_dir = '/path/to/source_folder'
target_dir = '/path/to/dest_folder'
    
file_names = os.listdir(source_dir)
    
for file_name in file_names:
    shutil.move(os.path.join(source_dir, file_name), target_dir)
Posted by: Guest on March-17-2021

Code answers related to "how to move all html files from one directory to other using python"

Browse Popular Code Answers by Language