-1

I need to write python code to move a file from one folder (Folder 1 )to another (Folder 2) if the folder 2 does not contain the file. I want to know if we should use shutil.copy

Harikrishna
  • 1,100
  • 5
  • 13
  • 30

1 Answers1

1

try this out

if not os.path.exists('destination path'):
    shutil.move("path/to/current/file.foo",
                "path/to/new/destination/for/file.foo")
0xMH
  • 1,825
  • 20
  • 26