why?

Eugene Goodrich bitbucket at isomedia.com
Tue Dec 28 02:12:29 EST 1999


On Tue, 28 Dec 1999 03:40:32 GMT, "ekko" <kgandco at home.com> wrote:

>I don't know that much about Python and I have some questions. Why would I
>want to learn Python. What uses does it have? What kind of programs can I
>make with Python? Thanks.
>
>

I think it might be quicker if we answered the inverses of some of
these questions.  For instance, What uses doesn't it have?

As a newbie-in-transition, I can stick up for Python by saying that
it's easy to learn compared to a lot of other languages, but it
doesn't have a buncha lotta shortcomings like some of the other
(so-called) easy-to-learn languages.

Without going into detail about things the language offers, I can say*
that everything good you've ever heard about PERL is true about
Python, only moreso.  (And only a little of what you've heard is bad
about PERL is true about Python.)
(* I can say it, regardless of whether I'm right or wrong.)

To give some specifics about some tasks you can do with it, you can:
* fetch web pages with it and parse the results, removing HTML tags
and reformatting it to display the portions of the page one-by-one.
More specifically, you could make a script that asks for a word, looks
the word up at a web dictionary, de-HTMLizes the results and displays
them.
* talk to news servers, requesting headers for a bunch of news
articles you don't intend to read so you can strip out the email
addresses and put them in a database.  (Please note that doing this
can shorten your lifespan by a lot.)
* parse 2,000 word-perfect macro files that each contain a single
person's or company's snail-mail contact information and put all the
names and addresses into a CSV text file for someone to import into an
address book.
* open Microsoft Excel (r,c,whatever) files using Microsoft Excel (via
COM) and change them or convert them to a different format.
* simulate different web browsers and/or make a large number of
requests of a web server to test features of a dynamic website, such
as web-based voting or browser-capability-detection.
* clean dinosaur-bone data out of Microsoft Access databases,
connecting to them and running queries using Microsoft Access Data
Objects (unless you'd prefer to do it a more difficult way).
* recursively read all the directories on your hard disk and make a
framed HTML index of all the jpeg images, so that loading this page in
a web browser and clicking on the index items seamlessly brings up the
indicated jpeg in the other frame window.
* write a distributed application that involves worker scripts that
run on a remote computer with a high-speed internet connection and do
a lot of web surfing and that connect to a "mother" machine across the
Internet that has a lower-speed connection but that has a SQL server
to store refined data in.  For added bonus points, implement a scheme
such that when the "mother" machine is disconnected from the
lower-speed connection every 5 hours and gets a new I.P. address when
it reconnects, the "child" machine(s) can learn the "mother" machine's
new I.P. address.
* Replace VBScript as your language of choice for writing ASP pages.
An added benefit of doing this is that you're not totally locked into
using the Evil Empire's web server platform, because you'll know a
"civilized" language.

This list is not exhaustive, just as explaining that you can write
poems and shopping lists with a pen and paper is not exhaustive of the
activities a pen and paper can perform.  And I may or may not have
done all, some, or any of the above items.

(I'll let the others talk about features, comparisons to other
languages, syntactical joys, and the other 99 billion uses I didn't
list.)

      -Eugene
import binascii; print binascii.a2b_base64 ('ZXVnZW5lQGlzb21lZGlhLmNvbQ==')



More information about the Python-list mailing list