Accessing a file in a network drive (python under win32)

logistix logistix at
Thu Jan 23 00:30:28 CET 2003

akineko at (Aki Niimura) wrote in message news:<b714b8de.0301220949.214886e at>...
> Hi everyone,
> I'm porting a program written in Unix to Windows environment.
> When I tried to open a file in a network drive (which is from SAMBA server) 
> using tkFileDialog.askopenfile(), I got the following error message:
> IOError: [Errno 2] No such file or directory: '//Evelyn/ms_share/python_win32/jt
> ag/'
> However ...
> (1) It won't complain if I access a file in a local drive (ex) 'C:/config.sys'
> (2) I can open the file from IDLE Python Shell
> >>> fd = open('//Evelyn/ms_share/python_win32/jtag/', 'r')
> Does anybody have an idea what is going on here?
> I'm not export on Windows. But why can't Windows be more like Unix?
> Any info would be highly appreciated.
> Aki-

Try using windows delimiters:
fd = open(r"\\Evelyn\ms_share\python_win32\jtag\")

Notice I used a re string so that I didn't need to escape each backslash:

More information about the Python-list mailing list