[Tutor] omit some keys from dict [lingo and libraries and api's, oh my!]
Sun, 10 Feb 2002 23:09:52 -0500
On Sunday, February 10, 2002, at 10:17 PM, Danny Yoo wrote:
> 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:
> 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.
I saw one called "httplib" in that list (or something to that effect).
It appears to allow the Python programmer to communicate with a remote
machine using HTTP GET and POST requests. In the example provided for
the library, they show the code with the three greater-than symbols that
suggest that the code is typed at the interpreter prompt.
I opened up my shell and fired up the interpreter to try these examples
out. The output was slightly different, but I did in fact get the
status: 200 reason: OK from the first part of the top example. (The
different output was that the second code batch of the top example, the
GET "/parrot.spam", returned a 200 but no "reason".)
So does this mean that I can basically access sockets from the
interpreter using Python? If that's the case then this isn't going to
be as difficult to learn as I thought! What a great idea!