import shutilos from pathlib import path path home(shutil copytree( 'spam' 'spam_backup'windowspath(' :/users/al/spam_backup'the shutil copytree(call creates new folder named spam_backup with the same content as the original spam folder you have now safely backed up your preciousprecious spam moving and renaming files and folders calling shutil move(sourcedestinationwill move the file or folder at the path source to the path destination and will return string of the absolute path of the new location if destination points to folderthe source file gets moved into destination and keeps its current filename for exampleenter the following into the interactive shellimport shutil shutil move(' :\\bacon txt'' :\\eggs'' :\\eggs\\bacon txtassuming folder named eggs already exists in the :directorythis shutil move(call says"move :\bacon txt into the folder :\eggs if there had been bacon txt file already in :\eggsit would have been overwritten since it' easy to accidentally overwrite files in this wayyou should take some care when using move(the destination path can also specify filename in the following examplethe source file is moved and renamed shutil move(' :\\bacon txt'' :\\eggs\\new_bacon txt'' :\\eggs\\new_bacon txtthis line says"move :\bacon txt into the folder :\eggsand while you're at itrename that bacon txt file to new_bacon txt both of the previous examples worked under the assumption that there was folder eggs in the :directory but if there is no eggs folderthen move(will rename bacon txt to file named eggs shutil move(' :\\bacon txt'' :\\eggs'' :\\eggsheremove(can' find folder named eggs in the :directory and so assumes that destination must be specifying filenamenot folder so the bacon txt text file is renamed to eggs ( text file without the txt file extension)--probably not what you wantedthis can be tough-to-spot bug in your programs since the move(call can happily do something that might be organizing files