move file python

# To move a file in Python, use one of the following:
import os
import shutil

os.rename("path/to/current/", "path/to/new/destination/for/")
shutil.move("path/to/current/", "path/to/new/destination/for/")
os.replace("path/to/current/", "path/to/new/destination/for/")

# In the first two cases the directory in which the new file
# is being created must already exist.

Here is what the above code is Doing:
1. Importing the os and shutil modules.
2. Renaming a file using the os.rename() method.
3. Moving a file using the shutil.move() method.
4. Replacing a file using the os.replace() method.