Is this a dream or a nightmare? (Was Re: XML)

David T. Grove pete at petes-place.com
Sun Oct 8 12:55:48 EDT 2000


On Sun, 08 Oct 2000 10:09:36 +0100, Grant Griffin <g2 at seebelow.org>
wrote:

>> > Actually, fully extended, it means "give me a platform independent
>> > list of writable (non-directory) files in that directory in a form
>> > that will allow me to name the files so that I can see them from
>> > elsewhere in my code regardless of where they are on disk, or halt
>> > immediately because if this doesn't work you might screw something
>> > up".
>> 
>> import os, stat
>> basedir = os.path.normpath("/code")
>> paths = [os.path.join(basedir, f) for f in os.listdir(basedir)]
>> d = [p for p in paths if os.path.isfile(p)
>>                       if os.stat(p)[stat.ST_MODE] & 0222]
>
>Hey, waitaminute!  It this a case where the Python code is actually
>_smaller_ than the "natural language" equivalent above?

Why do you think I'm wanting to migrate to Python rather than, say,
C++, with its ungodly verbosity? (Yes, Alex, that's a jab.) Of course,
for a Perl programmer, I'm completely used to this situation. To me,
if it takes more to express it in code than it takes to express what
you want in natural language, then you're doing it wrong. ;-))

My boss has always wondered why I'm more partial to doing it myself
rather than giving good specifications to have someone else do it. The
problem is, by the time the specs are written, I could have programmed
it myself.

>maybe-guido-is-secretly-a-linguist-like-larry-wall-<wink>-ly y'rs,

Guido's no linguist, but he _is_ one helluva computer scientist. At
least, I've never seen python poetry.





More information about the Python-list mailing list