How to copy file from a network using Python

6.4k Views Asked by At

I want to use Python to copy a zip file (test.zip) from shared network (\svr\shared) to my local computer C:\ drive. Also, my windows account already has access to the network.

One more thing, how can I get the content of a network shared folder? Let's say, I need all the file names located at \svr\shared.

1

There are 1 best solutions below

1
On BEST ANSWER

Try this:

from shutil import copyfile
src = r'\svr\shared\test.zip'
dst = r'C:\test.zip'
copyfile(src, dst)