Difference between libraries and frameworks

Guido,

This is my empirical test for what is a library and what is a framework:

If I can use it from the Read-Eval-Print-Loop, it’s a library. Otherwise, it’s a framework.

There are quite a few libraries that are actually frameworks hiding in the Standard Python Library. xml.sax requires subclassing. Can anyone tell me how I’m supposed to experiment with this from the interpreter? Other frameworks are: HTMLParser, sgmllib, htmllib. Experimenting with screen-scraping using these libraries has never been so un-fun. In contrast, libraries such as urllib are pure pleasure to use.

How do you do your python development? Do you use the interpreter to test out code or do you prefer to run test-driven scripts?

One Response to “Difference between libraries and frameworks”

  1. Paddy McCarthy writes:

    > How do you do your python development? Do you use the interpreter to
    > test out code or do you prefer to run test-driven scripts?

    I use the shell, then doctest.

Leave a Reply