Search code examples
pythonwindowsshared-directory

Using Windows network path with python


Is possible to use windows network path with python functions?

ex. //SERVERNAME/SharedFolder

For example something like os.makedirs('////SERVERNAME//SharedFolder//NewFolder')

It seems it doesn't work for me

Thanks, Federico


Solution

  • Try using raw string.

    Ex:

    os.makedirs(r'\\SERVERNAME\SharedFolder\NewFolder')