What's the best way to copy and move files in python to a different directory, and overwrite those files in the destination if they already exist?
            Asked
            
        
        
            Active
            
        
            Viewed 1,769 times
        
    -3
            
            
        - 
                    8Already [asked](http://stackoverflow.com/questions/123198/how-do-i-copy-a-file-in-python)? – Onlyjus Sep 09 '12 at 00:47
2 Answers
0
            
            
        file1=open('insert directory here').readlines()
file2=open('insert directory here', 'w')
file2.write(file1)
If either of the directories have spaces in them do this:
directory='insert directory here'
directory=directory.rstrip()
Then use the variable directory as you would use the 'insert directory here'.
 
    
    
        ThisIsAQuestion
        
- 1,887
- 14
- 20
