-1

Now, before this question gets reported as a duplicate, I have searched all other questions but they just don't work for me. I want to send an image from the current working directory to an external folder.

crnt={current-working-directory}
dest={destination-folder}
anothaone
  • 21
  • 5

2 Answers2

0

If you need to copy then go with this

shutil.copyfile(src, dst)

If you want to move then you could use

shutil.move(src, dst)

I hope this answers your question

Shashank
  • 11
  • 3
-1

You could use os like this:

import os

crnt={file-location}
dest={file-destination}    
os.system(f"mv {crnt} {dest}")

Or for a more traditional way you could do this:

crnt={file-location}
dest={file-destination} 

with open(f"{crnt}", "rb") as ogFile:
    bData = ogFile.read()

with open(f"{dest}", "wb") as destFile:
    destFile.write(bData)