[Tutor] Finding bottom level directories, and command-line arguments

Simon Gerber nequeo at gmail.com
Thu Feb 9 02:35:49 CET 2006


Hi Danny,

> That web site (http://thedailywtf.com) is amusing in its way, but my
> problem with it is that so many of the people there enjoy mocking others
> in a mean-spirited and immature way.  Programming well is a hard thing.
> The adolescent posturing I see there isn't admirable to me. It's also very
> sad to see that, for any given bad code, there's a lot more really bad
> responses.  So my feelings are mixed about it, in the same sort of way
> that I have misgivings toward Slashdot.  *grin*

Yes... Slashdot. *shudder*. I've had two of my articles Slashdotted,
and both times it left quite a bruise. If it happens again, I have
resolved to simply not read the comments. Like Othello said, there are
some things we are better off not knowing :)

> It's perfectly ok to take advantage of os.walk(); I like this code.

Excellent. But based on Kent's comment, I have discovered that

------
for root, dirs, files in os.walk(prog_variables['vid_path']):
    if dirs == []: print root
------

does the same thing.

Cheers,

--
Seen in the release notes for ACPI-support 0.34:

'The "I do not wish to discuss it" release
  * Add workaround for prodding fans back into life on resume
  * Add sick evil code for doing sick evil things to sick evil
    screensavers'


More information about the Tutor mailing list