You can either use
shutil[
^] OR
os[
^]
Example:-
Using
shutil
import shutil
shutil.move("pathA/file1.html", "pathB/file1.html")
Using
os
:
import os
os.rename("pathA/file1.html", "pathB/file1.html")
os.replace("pathA/file1.html", "pathB/file1.html")
Now, with your code, you need to run them in your loop to make it happen.