Search

Geekophilia

User Interfaces Should Teach, Not Hide

Posted by Richard Dooling on August 21st, 2006

vim7Here’s a fresh look at the age-old tension between those who prefer the Command Line Interface (CLI) to the Graphical User Interface (GUI), by way of an example from my favorite text editor, Vim 7.0. Writing in the Free Software Magazine, Terry Hancock argues that user interfaces should teach, not hide.

“The key concept here is that we should view GUIs not as an opaque layer to separate the digital classes, but as a convenience to make learning easier”.

Probably the best essay on what some call “Interface Zen” is still Neal Stephenson’s In the Beginning was the Command Line, although it’s officially dated (written in 1999). Stephenson’s favorite operating system at the time was BeOS (now nearly extinct), but in a 2004 Slashdot interview, Stephenson wrote:

“I embraced OS X as soon as it was available and have never looked back. So a lot of ‘In the Beginning was the Command Line’ is now obsolete. I keep meaning to update it, but if I’m honest with myself, I have to say this is unlikely.”

In 2004, Garrett Birkel (with Neal Stephenson’s permission) republished Command Line, interspersing his own notes and comments, in an effort to bring the essay up to date, at least as of 2004.

Stephenson is being modest. Some of the inconsequential particulars of In the Beginning was the Command Line are dated, but most of the essay is a timless meditation on capitalism and the man-machine interface. Also, assuming that Stephenson embraced OS X because of its Unix Command Line, the essay still holds true: In the beginning was the command line, and in the end it’s still the most efficient tool for interacting with an operating system.

Richard Dooling

tech

Python On XP: 7 Minutes To “Hello World!”

Posted by Richard Dooling on March 14th, 2006

Python Logo

Python On Windows XP: 7 Minutes To “Hello World!”

Instead of being all things to all users, this little how-to assumes the following:

  • You are a Windows XP user who is curious about computer programming;
  • You would like to install the Python computer language on your Windows XP machine, start the Python interpreter, and run the classic “Hello World!” program.

(Any Vista users? You can help by leaving a note about any differences you encounter while following these instructions on Vista. Thanks, rd)

If you have questions, like “What is Python and why should I install it on my Windows XP computer?” go read Why Python on Windows XP? Come back if you want to install Python.

Back already? Never left? Okay, proceed.

A company called ActiveState makes a free, all-in-one Python distribution that has everything you need to run Python on Windows XP, with all of the “hooks” you’ll eventually want to control your Windows machine and Windows programs using Python.

I don’t work for ActiveState. I am not an affiliate. There is no affiliate id or code in the link I provide to their site. I get no fee or percentage from them. I am not a computer expert, nor am I a computer scientist, just a Python fan.

Ready? Assuming you have cable or DSL, you are less than seven minutes away from having Python installed on your computer and typing your first command at the interpreter prompt. Go!

  • Open another browser window (so you can keep reading this one) by pressing shift-and-click on the: ActivePython page of the ActiveState site.
  • You are on the ActivePython page. See the “Choose From” menu box, where the first choice is “ActivePython”? Next to it is a little blue Download button. Click on it.
  • Now a form appears where, if you wish, you may give ActiveState your name and email address. It’s not required. If you comply, you may receive one or two emails a year telling you about new distributions. If in doubt, skip it, come back later and sign up. Click “Continue“.
  • Now you’re on a page where you get to choose from a dozen different Python installations, just in case you are an Alpha Geek interested in installing Python on your Solaris Sparc WorkStation, your Slackware distro, or your AMD64 desktop. If you’re an Alpha Geek, you know which one to install, right? But you’re not an Alpha Geek (yet), you’re an average Windows XP user, right? So you want the newest version (2.5.1.1) and click on the one that says: “Windows (x86) (21.2 MB).” The actual link is the little “MSI” underneath.
  • Download this file and make a note of where you store it on your computer. It takes a few minutes to complete the download. Pass the time by recalling the “Bring Out Your Dead” scene from The Holy Grail. Done? Okay, go find the ActivePython file on your computer.
  • As of this writing, the file you downloaded is called “ActivePython-2.5.1.1-win32-x86.msi.” It’s about 21 megabytes, which is half the size of the last driver I installed for my Logitech Mouse.
  • Double-click on the ActivePython file.
  • Up pops the ActiveState box and tells you it’s going to install ActivePython. Click Next.
  • Up pops the Licensing Agreement. Check the Accept box. Click Next.
  • Up pops a dialogue box allowing you to customize the installation. Don’t customize it. Click Next.
  • See the button that says “Install”? Click it.
  • You’re done, and the ActivePython User Guide appears.
  • Now go to START | All Programs | ActiveState ActivePython 2.5.
  • The menu will break out into submenus. You want the one that says: “Pythonwin Editor.” Click on it.
  • You are now at the command prompt of the Python interpreter and ready to speak Parseltongue.
  • Your cursor will be blinking just to the right of a prompt that looks like this: >>>
  • Type the following command there and make sure that “Hello World!” is inside quotation marks:
    >>> print “Hello World!”
  • Press Enter. You should see Hello World! appear in a different-colored font on the line below.
  • If so, you’re done!

Python Logo

You are inside the interpreter of the Pythonwin IDE (Integrated Development Environment). Leave the Python interpreter open, ready, and waiting to take your commands. Go to one of the following tutorials, which will teach you how to use the Python interpreter to learn Python:

  • Learning To Program (if you’re in a hurry to type more commands into the interpreter, go straight to the “Simple Sequences” section of Professor Gauld’s justifiably famous tutorial).
  • A Beginner’s Python Tutorial. Steven Thurlow wrote this simple, excellent tutorial for the modding community of Firaxis’ Civilization. Useful to beginners with little or no programming knowledge.
  • Python Baby Steps Tutorial (a new, well-made tutorial that walks you through the basics of using the Python IDE to interact with the Python interpreter, or to make your first Python scripts).
  • One Day of IDLE Toying (made for a slightly different version of the IDE, but most instructions work fine with the Pythonwin IDE).
  • A Byte of Python (Keeps getting better. Now available on an easy-to-read wiki. It’s geared toward an IDE used on both Linux and Windows, so ignore the Linux instructions).

Once you become comfortable playing with the Python Interpreter, go to the BeginnersGuide/NonProgrammers page of the Python.org site and select more tutorials. There are plenty of good ones. All free!

Later, when you start learning to program and have more questions, visit the Python Users Group at Google Groups and search it. Chances are your question has already been asked and answered. Also, refer to this excellent Python Quick Reference sheet when you need help remembering commands.

If you prefer learning from a good Python book, 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, 3rd Ed., by Mark Lutz, commonly considered the most thorough introduction to the language for beginners, now out in a new 3rd edition that covers Python 2.5 and looks ahead to Python 3.0.
  • 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.

Have fun!

Richard Dooling

Why Python on Windows XP?

Posted by Richard Dooling on March 14th, 2006

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.

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

Diary of an Immortal Man

Posted by Richard Dooling on February 11th, 2002

Esquire Cover Immortal Man

Short Fiction by Richard Dooling

Diary Of An Immortal Man was a cover story for Esquire Magazine and was nominated for a National Magazine Award. The full text appears online at Kurzweil AI.

Diary Of An Immortal Man is kinky science fiction and black comedy, inspired in part by Ray Kurzweil’s tremendous book, The Age Of Spiritual Machines; both speculate about what the future holds for us and our biotech lust for immortality.

If you are a technology addict and haven’t tried Ray Kurzweil’s site, don’t go there until you have four or five hours to spare: KurzweilAI.

You will also find free samples of Ray’s new book, The Singularity Is Near: When Humans Transcend Biology.


Bad Behavior has blocked 401 access attempts in the last 7 days.