Instead of using copy file(src,dst), you can use the copy2(src,dst) as it allows dst to be a directory by default instead of mentioning the complete target file name, and in that the basename of src is generally used for forming the new file.
Refer to the below example:
import shutil
shutil.copy2('/src/dir/file.ext', '/dst/dir/newname.ext') # complete target filename given
shutil.copy2('/src/file.ext', '/dst/dir') # target filename is /dst/dir/file.ext
If you want to know more about Python, then do refer to the Python certification course that will help you out in a better way.