UNC paths in file object open

Peter Hansen peter at engcorp.com
Fri Mar 12 13:40:17 EST 2004


Graham wrote:

> I ma trying to open a file on a network share
> 
> ie \\servername\share\folder\file
> 
> afile = open( \\server\share\folder\file, "r" )
> 
> have also tried
> afile = open( //server/share/folder/file, "r" ) # as per the Python cookbook
> advice on page 113 namely " use / regardless of the proclivities of the
> underlying operating system".

Are the above actual examples of the code you typed?  If so, I suggest 
reviewing the tutorial... strings in Python always require surrounding 
quotation marks, either ' or ", and yours above have neither.



More information about the Python-list mailing list