source = ('C:\\AutoTransInt\\Input\\oplog\\*.csv')
destination=("C:\\AutoTransInt\\Input\\excel")
How to perform copy operation for above line using
copyfile(source,destination)
i am getting error when i tried to do this
source = ('C:\\AutoTransInt\\Input\\oplog\\*.csv')
destination=("C:\\AutoTransInt\\Input\\excel")
How to perform copy operation for above line using
copyfile(source,destination)
i am getting error when i tried to do this
You can use "shutil" that has many methods you can use. One of which is:
from shutil import copyfile
copyfile(src, dst)
you just has to add your source file to src object and destination file to dst object.
Description is as follow:
you can also use copy2 function of same library. 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