[Tutor] omit some keys from dict [lingo and libraries and api's, oh my!]

Danny Yoo dyoo@hkn.eecs.berkeley.edu
Sun, 10 Feb 2002 19:17:47 -0800 (PST)


On Sun, 10 Feb 2002, Erik Price wrote:

> What is the definition of "Library" in this case?  Is it just "the
> collective body of Python modules"?


By "library", I meant the collective body of Python modules, both in
Python or in C.  There's a comprehesive list of all of them here:

    http://www.python.org/doc/lib/

This is called the "Python Standard Library" because it's bundled with
Python --- every Python programmer can expect to see these modules as a
standard set of tools they can use.



> > The problem about these extension modules is that the C API evolves with
> > Python, and this likely breaks compatibility.
> 
> I see this acronym all the time, but I'm not terribly sure of what it
> is:  API.  If I'm not mistaken, IDE is like a program that allows you
> to code more easily than plaintext file editing (Integrated
> Development Environment), and API means "application programming
> interface" or something like that.  How is an API different from an
> IDE?

Ah; different concept.  An Application Programming Interface (API) is an
agreement on what sort of functions, classes, and variables will be
available for a programmer to use.


The term "API" and "module" are related, but there IS a difference --- an
API is a general, fuzzy concept, while a Python module is something solid,
something we can actually import.  A concrete example of an API is the
OpenGL standard:

    http://www.sgi.com/software/opengl/
    http://opengl.org/

OpenGL defines a set of functions we can use to control graphical displays
on a wide variety of computers.  The OpenGL API describes the kinds of
functions that a graphics programmer can expect to use, but doesn't really
mention how to implement such a beast.

However, Python has a module called PyOpenGL that actually implements this
API:

    http://pyopengl.sourceforge.net/

So the difference between an API and a module is that an Application
Programming Interface tells us what to expect, while a module is a thing
that can implement that Interface.


Sometimes, I'll get sloppy and say "API" when I mean "module" though, so
apologies in advance!  I'll try to be careful about my word usage.



> A very basic question but I keep seeing it when I go to the bookstore
> and read books about Python.  To think that I have already been coding
> in PHP for a little while and still don't know what it means.

No problem.  There are way too many acronyms in the world.  *grin*



> PS:  And while we're on the subject of IDEs, is IDLE available for Mac
> OS X in Aqua (not X11)?  I haven't seen anything about it but then
> maybe I just didn't look hard enough.

Hmmm!  I believe so, since the Apple folks finally ported Tkinter for OS
X in October:

    http://www.opensource.apple.com/news/index.html


Searching... ah!  Ok, check Tony Lownds's OS X/Python page for a
precompiled Python with Tkinter:

    http://tony.lownds.com/macosx/
    http://tony.lownds.com/macosx/idle_screenshot.png


Please feel free to ask more questions; I think I rushed things a bit.