Neeraj Neeraj - 4 months ago 40
Python Question

Using Python, how can I access a shared folder on windows network?

I have a file that I would like to copy from a shared folder which is in a shared folder on a different system, but on the same network. How can I access the folder/file? The usual open() method does not seem to work?

Answer

Use forward slashes to specify the UNC Path:

open('//HOST/share/path/to/file')

(if your Python client code is also running under Windows)

Comments