Pathing question on Windows

Emile van Sebille emile at
Fri Jan 18 16:46:34 EST 2002

From: "Tony Love" <Tony.Love at>
> I am running Python2.1 on WinNT and I would like to know how (if it is
> indeed possible) to use UNC nameing conventions instead of drive
> letters.  By UNC nameing I mean the format
> \\servername\share\path\filename  instead of H:\path\filename .  I
> know that simply useing a UNC path fails but I was wondering if there
> is a module or a syntax trick that I can employ to use the UNC paths.

Works here...

>>> target = r"\\fcme\Zope"
>>> import os
>>> os.listdir(target)

Perhaps you're not using a raw string or escaping the backslashes?

Emile van Sebille
emile at


More information about the Python-list mailing list