[Chicago] Reading From a Directory

Martin Maney maney at two14.net
Tue May 10 05:38:56 CEST 2011

On Mon, May 09, 2011 at 10:08:11PM -0500, Clyde Forrester wrote:
> I'm making the tough mental shift from
> It's so trivially easy that everyone EXCEPT Python has the ability
> to open, read, and close a directory. What could be easier?
> to
> Just because you CAN do it that way, doesn't mean you SHOULD. Or,
> for that matter, that it's the most direct or simplest way.

Well, you CAN do it that way... in, say, Perl.  In C, C++, Python, and
a horde of other languages, it's not a hardwired feature of the
language, but an external function.  Modules (and Packages) are
Python's way of managing external code.  In fact, despite the different
appearances, ALL these languages "pass the buck" to the OS in the end:
they only differ in how they present the slot for receiving the buck. 
And a bazillion other things are like this...

> Yeah, yeah. I'll get over it.

I hope you do, because Python very generally prefers to package things
into modules rather than making them builtins or keywords or whatever. 
You don't half know what Python is if you haven't gotten to know the
standard library.  Not know it all by heart - I doubt anyone does.  But
knowing that it's there, and how to find out what's in there that you
don't already know about is not important, it's essential.

During almost fifteen centuries has the legal establishment of
Christianity been on trial.  What have been its fruits?  More or less
in all places, pride and indolence in the Clergy, ignorance and
servility in the laity, in both, superstition, bigotry and persecution.
  --  James Madison

More information about the Chicago mailing list