On 11/11/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Shi Mu wrote: > > > 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 > > is that the entire script? you're defining a function, but you're > not calling it. try adding > > print buildList() > > at the end of the script.
It works but i am curious why the line of "print x" does not show anything. many thanks! -- http://mail.python.org/mailman/listinfo/python-list