You can use os.rename() or shutil.move()for moving a file in Python
See the code below while both employ the same syntax:-
import os
import shutil
os.rename("path/to/current/file.foo", "path/to/new/destination/for/file.foo") shutil.move("path/to/current/file.foo", "path/to/new/destination/for/file.foo")
To know more about this you can have a look at the following video tutorial:-