Here i am trying to copy a file from a source location to the target location.
from shutil import copy2
sourcefile = "file.avro"
targetdirectory = "/home"
copy2(soucefil,targetdirectory)
But i need to copy the file to the new location with a different name say file.avro.copy Is there any python library that can be used for renaming file while copying itself. Donot want to copy and rename in two different steps.