I've read a few articles on Stackoverflow about shutil.move, copy and rename. Using those references, I still can't seem to execute this script without errors under a Windows 7 Professional environment using Python 2.7.
What am I doing wrong here?
import shutil
shutil.move('C:/Data/Download/Somefile.txt.zip','C:/Data/Archive/')
Error:
No such file or directory: C:/Data/Download/Somefile.txt.zip
I've tried //, \ and other paths with no result. What am I missing here?
Here is the reference script I was using:
import shutil
import os
source = os.listdir("/tmp/")
destination = "/tmp/newfolder/"
for files in source:
if files.endswith(".txt"):
shutil.copy(files,destination)