python move files code example
Example 1: python move file
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")
os.replace("path/to/current/file.foo", "path/to/new/destination/for/file.foo")
Example 2: copy files python
from shutil import copyfile
copyfile(src, dst)
Example 3: python move file
import os, shutil
shutil.move('/some/dir/picture.png', '/another/dir/Pictures/')
Example 4: move file python
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")
os.replace("path/to/current/file.foo", "path/to/new/destination/for/file.foo")