Why Python on Windows XP?

by Richard Dooling on March 14, 2006

in Geekophilia, Python

Python Logo

If you don’t know any computer languages, I recommend starting with Python. It is cleanly designed, well documented, and relatively kind to beginners. Despite being a good first language, it is not just a toy; it is very powerful and flexible and well suited for large projects.

From How To Become A Hacker, by Eric S. Raymond, author of The Cathedral and the Bazaar and Why Python?

Why Python On Windows XP?

Python is an interpreted programming language. On Windows, amateurs (like me) use it as a scripting language. If you’ve dabbled in creating macros in Microsoft Word or experimented with various hot-key or keyboard macro programs, you have a mere inkling of how useful a scripting language can be. Learning to program in a REAL computer language, like Python, enables you to make small, fast, accurate, customized scripts and “applets” that do exactly what you want them to do on your computer.

A simple example will suffice. Isn’t Google Desktop Search handy? Yes. Sometimes. But how often does your search produce “179 emails, 468 files, 273 Web History.” Instead of loading huge indexing programs to find a single file, wouldn’t it be nice if you could type a few commands into your Python interpreter and tell your computer to search only Microsoft Word documents for the word “Bartleby” in the “Novels” folder?

Once you know Python, you can do just that, and you can save your little program in a script file that will allow you to run it again whenever you want. The next time you might tell your program to search only plain text documents for the word “gloaming” in the “My Documents” folder. Just one trivial example.

Learning a real programming language takes too much time, right? Yes! And if the prospect of spending time learning a new language makes you uneasy, please leave now. Learning any language takes time and effort. Don’t learn French, unless you enjoy it, are curious about French culture, and perhaps would like to travel to France. If you are reading this, you are at least curious about computer programming. My advice is to try it. If you don’t like it. Quit!

Before you go, consider the time you have invested over the years learning to “speak” the language of individual programs, like Microsoft Word. When you learn how to make Word macros, or how to program keyboard macro software, you have expended a lot of time and effort learning the language of a single program on a single platform (Windows). When you learn a language like Python, you learn to control almost any program on any platform (Windows, Linux, Mac OS X), because Python runs on all of these and comes preinstalled on Mac OS X and Linux. When you learn Python, you also learn computer science and at least the basics of how to program computers.

Some of the best programming tutorials on the Web use Python to teach curious newcomers how to program. Why? Python is easy to learn, but very powerful. It’s checkers if you just want to play around, and it’s Grand Master chess if you decide you’re in for the long haul. Google uses Python. NASA uses Python. You can use Python, too.

If you want to know more about Python, read about it at Wikipedia, or poke around the Python.org site. Don’t be put off by the high-level geek jargon. If you are new to programming, your best bet is the BeginnersGuide/NonProgrammers page. If you have questions, visit the Python.org General Python FAQ page. Later, when you get in over your head and want to ask questions or seek advice, go to the Python Users Group at Google Groups.

Above all, remember that programming in Python should be FUN. The guy who wrote Python (Guido van Rossum) now works at Google. He named Python after the Monty Python comedy troupe, not the snake. Python programming tutorials borrow from Monty Python whenever possible. For instance, here is a link to the famous Monty Python Dead Parrot sketch on YouTube, and here is a link to Guido van Rossum’s Python tutorial illustrating the use of keyword arguments in functions with lines from the Dead Parrot Sketch.

If you are a Windows XP user and want to install Python on your computer, visit: Python on Win XP: Seven Minutes To “Hello World”.

If you want to read a good Python book while you are learning, try one of these two written for beginners:

After you acquire basic knowledge in Python, you can move onto some other great books:

  • The Python Cookbook, 2nd Ed., by Alex Martelli, et. al, which provides “recipes” for common tasks you might like to accomplish using Python on your computer. For many people, this is the best way to learn code, by studying examples contained in programs that do useful work.
  • Learning Python, 2nd Ed., by Mark Lutz, commonly considered the most thorough introduction to the language for beginners.
  • Python: Essential Reference, 3rd Ed., by David M. Beazley. This is the newest of the Python books and probably the best all-around Python book, but newbies may find it overly terse. Beazley wastes no words and has a tight, crisp writing style. If you are already familiar with basic programming concepts, but are new to Python, Beazley is your man.

Good luck and have fun!

Richard Dooling

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

{ 15 comments… read them below or add one }

SatyamTanikella June 30, 2006 at 5:09 am

It is encouraging I will master python

ed keyes May 30, 2007 at 8:50 am

at 52, I want to save the world through Python :)

Richard Dooling May 30, 2007 at 1:27 pm

Ed, go for it.

It’s a good language for us old guys. Great for writers, too. It’s much more plain English than the other languages.

books = ["Tale of Two Cities", "The Shining", "Grapes of Wrath"]
for book in books:
print book

Tale of Two Cities
The Shining
Grapes of Wrath

Or as the saying goes, “Python fits your brain.”

Good luck,

rd

Asp April 1, 2008 at 1:26 am

You should clarify that buying an expensive hard copy of the Cookbook is pointless. It’s online, free, continually updated and corrected, and searchable.

B Travis May 21, 2008 at 1:10 am

Good article. I love Python also.

Pete May 27, 2008 at 8:10 am

Just taken my first step into a bigger world, i’m quite excited ;-)

Brealyant August 4, 2008 at 9:10 pm

Let us begin.

Daniel September 29, 2008 at 9:20 pm

“How to think like a computer scientist” has been updated and modified more specifically for Python. In fact it is now called “Think Python – an introduction to software design” Version 1.1.1.4.

Ann October 4, 2008 at 9:11 pm

Hi! I’m trying to learn this to develop MT. I would just like to ask if this could also be used to manipulate images for MT or if there’s a tutorial out there? Thanks

Richard Dooling October 5, 2008 at 11:54 am

Dear Ann:

Not sure what MT is but this sounds like or perfect question for the Python Google Group:

http://groups.google.com/group/comp.lang.python

Or Google itself yields this:

http://sandbox.mc.edu/friendly_python/lab4.html

Good luck!

RD

thilak November 18, 2008 at 11:22 pm

i really want to master in python. guide me please!!

Blaze December 30, 2008 at 1:16 pm

Hello all , I have a quick question, I have downloaded a software program call Blender which is a 3D program. The tutorial that I read for Blender states that I have to have both Blender and Python loaded to make the program work. I am running XP on my computer. But I don’t plan on actually writing any computer language. I intially downloaded the Window Installer package Python 2.61 MSI. I read more info on the Python site and notice the link about XP. I read that link and now I’m confuse, do I need the Download for XP even though I don’t plan on writing any program lanuage or at least I don’t think I will be. I just plan on using the Blender software for now. I have no knowledge what so ever on writing any program lanauge except HMTL and CSS and that just basic. I have not install the Python on my computer yet I have just downloaded and save it. Any help would be great .

Thanks

koti January 14, 2009 at 6:19 am

hey can you please what advantages it offers for me above pearl,C++…..
I’m planning to go ahead and learn a prog language onter then those in my acadamics…..I’ve already started python by the way…..

Art February 22, 2009 at 6:41 pm

And now for something completely different, A man with 3 buttocks!!

Fay May 10, 2009 at 9:33 pm

I like using vbscript. Here is a macro template for it. http://vbscript-macro-template.blogspot.com/

Leave a Comment