On 11 Nov 2005 22:00:04 GMT, Michael Konrad <[EMAIL PROTECTED]> wrote: > Richard Townsend <[EMAIL PROTECTED]> wrote: > > > On 11 Nov 2005 21:20:33 GMT, SU News Server wrote: > > > > Try passing the full pathname of each item to os.path.isdir() > > > > You can create the pathname using os.path.join(directory, x) > > > > > > > > I wonder if I can join ./, so I don't have the full path in each > entry? > > Thank you for responding. > _Michael > > > -- > http://mail.python.org/mailman/listinfo/python-list > I tried this and no error reported but nothing appear on the console, why?
import os 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 -- http://mail.python.org/mailman/listinfo/python-list