-1

I have a file called C:\skor\test.xlsx And I need create a copy of it in C:\skor2\

pd.read_excel and df.to_excel - cannot be used

Basically I need to copy the file without opening it.

asymon
  • 187
  • 9

2 Answers2

0

use below code:

from shutil import copyfile

copyfile("C:\skor\test.xlsx", "C:\skor2\test.xlsx")
0

Use this.

it will Copy the contents of the file named src to a file named dst. Note :-> The destination location must be writable; otherwise, an IOError exception will be raised. If dst already exists, it will be replaced. src and dst are path names given as strings.

from shutil import copyfile
copyfile(src, dst)