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.
</F>
--
http://mail.python.org/mailman/listinfo/python-list