Shi Mu wrote: > On 11/11/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >>Shi Mu wrote: >>>def buildList( directory='c:\TEMP' ): >>> dirs = [ ] >>> listing = os.listdir(directory) >>> for x in listing: >>> x = os.path.join(directory, x) >>> print x >>> if os.path.isdir(x): >>> dirs.append(x) >>> return dirs > > It works but i am curious why the line of "print x" does not show > anything. many thanks!
Did you use directory='c:\TEMP' as shown above, or directory='c:\temp' ? If you used the lower case version, you are not really checking the temp directory, since \t represents a TAB character. If that's the case, try using a forward slash instead: c:/temp . -Peter -- http://mail.python.org/mailman/listinfo/python-list