Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

move a file in python

import os
import shutil

# three different methods to move a file in python
os.rename("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")
shutil.move("path/to/current/file.foo", "path/to/new/destination/for/file.foo")
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #move #file #python
ADD COMMENT
Topic
Name
9+3 =