It looks like you aren't giving the full path to shutil.move
. Try:
if _file.startswith(start):
shutil.move(os.path.abspath(_file), new_dir)
If that fails, try printing _file
, and new_dir
along with the result of os.getcwd()
and adding them to your answer.