os.listdir("\\\\delta\\public")

Ishwor ishwor.gurung at gmail.com
Sat Dec 4 11:25:06 EST 2004


hi check your seperator variable in the os module.
:)
for example

>>> import os
>>> os.sep
'\\'
Now what you do is :-
>> os.listdir("D:" + os.sep + "any_other_folder_name" + os.sep);
:)

Have a look at the error below which is same as yours. The seperator
variable is put after the drive name and not before the drive name.
>>> os.listdir("\\c");

Traceback (most recent call last):
 File "<pyshell#21>", line 1, in -toplevel-
   os.listdir("\\c");
WindowsError: [Errno 3] The system cannot find the path specified: '\\c/*.*'

In Linux this would be somewhat like this
>>> os.listdir("/dev");
In general use the most platform independent variable names (e.g
os.sep) unless you intend the program to be used only by yourself. :)

[snip]

--
cheers,
Ishwor Gurung



More information about the Python-list mailing list