TweetFollow Us on Twitter

Programming Python

Volume Number: 21 (2005)
Issue Number: 3
Column Tag: Programming

Programming Python

by Christopher Roach

A Gentle Introduction to the Python Programming Language


I know what you're thinking. "With all of the languages out there why would I ever want to learn another one?" Well, if you've never used Python, and you've never had any desire to, then I'm sure this very statement can be found rolling around in your noggin at this very moment. But wait--hold on just a minute--there are several reasons for learning Python. For instance, in the essay "The Python Paradox" Paul Graham states one of the most important reasons for learning Python. In it, he states simply that "...Python programmers are smart."

Well, I'm not sure about you, but for me, the sheer fact that Paul Graham considers Python programmers to be of a higher intellectual caste is reason enough to learn the language. (In case you couldn't tell, I'm a big fan of Paul Graham's essays and his insights into the hacker community.)

Nevertheless, if you haven't found yourself totally convinced by Dr. Graham's musings that good hackers prefer Python, you may want to read on just a bit further. The rest of this article promises to go over several of the reasons why you would want to add Python to your programming toolbox.

We'll start with a short description of the Python language, and what advantages it holds for its users. Then, in the latter half of the article, we'll take a look at several code editors and IDEs and even one stand alone RAD tool, all of which will surely help make your transition from relative newbie to Python power-user an easy one.

Before we get started, however, if you already consider yourself to be a fairly erudite Python developer, don't turn away from this article just yet. As I mentioned in the previous paragraph, we'll be reviewing quite a few development tools that could easily help out even the most experienced Python developer. So, you may just want to skip the next section (since it mainly just synopsizes Python for the newbie) and proceed onto the rest of the article where you'll hopefully find some nice new toys to play with.

However, if you have no previous Python experience and you find yourself interested in learning what all the hype surrounding Python is about, go ahead and read on--the next section is just for you.

Why Python?

Let's start with a good overview of Python. Python is an interpreted, dynamic, object-oriented programming language. Sounds great right? But what exactly do all those terms mean to me? Well, let's look at the attributes mentioned above and discuss the benefits each provides.

First, Python is an interpreted language. Unlike many traditional programming languages in wide use today--such as C, C++, and Java--Python is not compiled. This has many benefits to a programmer. To start with, it means that programs can be written and executed instantly without a costly compile step. This cuts down on the edit-test-debug cycle by allowing us to immediately see the results of changes to our code. It also means that we can write very small programs interactively (i.e., each line of code is executed as we type it to give us immediate feedback). What this means is that any small task that calls for a short throwaway program can be created on the fly (I love this feature). Plus, learning new features of the language is a snap since all you have to do is open a command prompt and run the interpreter to execute, on the fly, everything you type rather than going through the arduous process of creating a file, adding the code, compiling it, executing it, fixing it, etc.

Second, Python is a dynamically typed language. A dynamically typed language is one that does not need to know the data type of a variable at compile time, but rather it can determine the data type during the runtime of the application through the context in which it is used. Thus, when using Python, the time consuming practice of declaring all variables is avoided. If you need a variable to hold a string, simply create a variable and assign a string to it. There's no need to tell the compiler what the data type of your variable is, it can figure it out on its own. This leads to a much faster development cycle.

Finally, Python is an object-oriented language. Now, since this article assumes that the reader has at least a small knowledge of programming (and hasn't been living under a rock in the recent computing past), I'll spare you the details of the benefits found in using a language possessing object-oriented capability. I'll just say quickly that, unlike other languages, such as Perl and C++, Python was developed from the ground up with the object-oriented paradigm in mind. This means that creating a fully object-oriented program in Python is much more natural than it is in other procedural-turned-object-oriented languages.

Well, that's a nice description, but what else can Python do for me? Glad you asked. A few of "my" favorite reasons for using Python are readability, portability, and a large selection of libraries and active developers. Let's take a look at what each can do for you.

The first advantage I've named could seem to be either a curse or a godsend at first, but most users of Python have grown to think of it as the latter once they got used to it. Python has a rather quirky way of designating blocks of code that will probably drive you nuts at first if you are a C/C++ or Java programmer by trade. It designates code blocks without the use of braces or begin-end statements. Instead, Python uses indentation. This may seem like a very annoying trait at first, however, once you've had to work on a project with at least one other coder and tried to read their ill-formatted code, you'll be praising this feature in no time.

Python's use of indentation-designated blocks of code is efficient, clean, and understandable, plus it makes sure that everyone on a programming project follows an identical indentation scheme. It may take a few short programs, but once you've gotten used to it, and you use a good editor like Emacs that takes care of the indenting for you, you'll find you actually produce code a bit faster now that you are able to forget about matching up braces or typing out the words begin and end all of the time. Thus, Python ensures a certain amount of consistency across developers and provides a certain amount of brevity for the single developer.

Next, and one of my absolute favorite features of the language, is the availability of the language on nearly every platform. At home, I do all of my development on an Apple Powerbook running Mac OS X v10.3 (Panther). At work, I do all of my development on a Dell either running Windows XP or Redhat Linux. On all of these platforms I am able to use Python as my scripting language of choice. What this means is that a program I write at home can be ported over to my work computer without any fuss, and vice-versa. Throw in the availability of several cross-platform GUI libraries for Python, and you have a complete solution for developing applications that can be used on virtually every popular operating system and computer architecture in use today. This also means that programs you develop will be available to a larger audience, than say; a program developed using Objective-C and Cocoa.

The final advantage I've listed declares quite a bit in one statement. First, you should know that Python has been around for a while. It's been around long enough to have developed a strong and very loyal following (in fact, the computing powerhouse, Google, asks for Python experience in nearly all of their employees. Now that's an endorsement), but just short enough to still be considered a modern programming language.

Initially developed around 1990 at the CWI (a research institute specializing in mathematics and computer science in the Netherlands) by Guido Van Rossum, the language has been widely accepted by the programming community, especially those involved in system administration, the Open Source community, and the hacker community (as described by Paul Graham in his essay "Great Hackers "). The language has a very strong following and because of this, it is always evolving and gaining new libraries and abilities. It is definitely not a dead language, and in fact, it is currently under the control of the Python Software Foundation, a group that is dedicated to the advancement of open source technology related to the language. It's also nice to know that at the helm of this foundation is the creator of the language himself. This amount of support ensures that Python has a large community of developers available for help and questioning as well as libraries for nearly every need imaginable.

So, now that you have a good overview of the Python language and what it can do for you as a developer, you may want to take the time to actually learn the language. If you're cheap, or perhaps just broke, you're in luck. Just like any other language popular amongst hackers, Python has quite a large number of online tutorials, references, sample programs--you name it. Just about everything you need to learn the language can be found for free on the internet. You'll definitely want to check out the tutorial on the main Python website [] and after you've got the basics down, you may also want to check out the Python Cookbook [] to find some nice recipes for your own development.

I'll go ahead and make the assumption that since you've read this far, I've already piqued your interest enough to make you want to go out and learn the language. However, if you're going to learn Python you might as well do it in style. That's where the rest of the article comes in.

The remainder of this article is going to go over some of the code editors and IDEs that you can use on OS X to develop your Python scripts. So, get out your laptop, or fire up your desktop, grab yourself a nice cup of coffee, or whichever caffeinated life support--err...I mean beverage--you drink regularly, and get ready to start some downloading. After all, you don't want to be the last one on your block still using TextEdit to write your Python scripts, now do you?

However, Before We Get Started...

Before we get started with our journey, however, we need to make sure that we are all starting on the same page. The Mac OS, from about v10.2 (Jaguar) and above, has come with a preinstalled version of the Python programming language. However, at last check, the version that came with the operating system was v2.2. So, before we get started with our journey into the wonders of Python on the Mac, we need to download and install the latest version of the Python programming language (v2.3 as of this article's writing) which can be found at the MacPython website [].

Once you've got the latest version of MacPython installed on your system, you're ready to start playing around with Python. But, before we can do that, there is still one last problem in need of a resolution.

Many of the IDEs that we will be reviewing in the next section of this article were developed in Python using the wxPython GUI library. So, in order for us to use these applications we're going to need a copy of wxPython installed on our system

You can download a copy of the most current library from its homepage [], however, you'll find that if you install the most up to date edition of the library, the Boa Constructor IDE that we will discuss shortly, will not run. In order to make use of Boa, you'll need an earlier version of wxPython: wxPython v2.4.2.4. To get a copy of this version you'll need to download it from the Sourceforge repository at the following address:

Luckily, the install is extremely easy, since, both the current version (v2.5.2.8) and the earlier version (v2.4.2.4) have installer packages made for them. All you have to do is download the package at the aforementioned URL and follow the steps to get it installed.

Once you've got the current version of MacPython and wxPython v2.4.2.4 installed, you're ready to start experimenting with the myriad of development tools available to the Python programmer.

Code Editors And Integrated Development Environments

Well, now that we have downloaded and installed a copy of MacPython and the wxPython GUI libraries on our system, we should be able to try out some of the development environments available for Python. Several possibilities exist for the Python developer looking for an IDE or a simple code editor on the Mac and this section introduces quite a few of each.

For anyone who's looking for a simple code editor for Python, the choices are nearly limitless and most are quite good. In this category, we'll look into a couple of classic and powerful editors that already come with your system: Vim and Emacs. However, if your interests lie in finding a full IDE comparable to Apple's Xcode or Microsoft's Visual Studio, Boa Constructor, or the Wing IDE should suffice. We'll cover both of these options and we'll even look into ways that we can use Xcode as our Python development environment. Finally, we'll review a RAD tool that allows us to quickly develop wxPython-based GUIs without writing a single line of code. As a bonus, the latter application should be useful to any Python developer using the wxPython GUI library regardless of which code editor or IDE they've chosen to use.

So, lets get started by taking a look at a couple of options for those of you just wanting a simple code editor that supports Python development with simple features such as syntax highlighting and perhaps automatic indentation. The first section covers the powerful and popular editors Emacs and Vim and discusses how to get them to grok Python.

Emacs and Vim

If what you're looking for is a simple code editor, then you'll find that a few come already installed and ready for work on your computer right out of the box. Mac OS X comes with two very popular and very powerful command line editors: Vim and Emacs. Both editors understand Python and can be coerced into providing syntax highlighting with very little effort.

I fired up Vim for the first time the other day just to try it out and see if it worked with Python, and it did perfectly. In fact, all I needed to do to add syntax coloring was to type :syntax on while in command mode, and Voila, beautiful syntax coloring right from the command line. You can also add that line (sans the preceding colon) to the .vimrc file in your home directory if you wish to always start the editor with syntax coloring turned on.

While many developers love Vim and wouldn't be caught coding with anything else, I personally find it to be a bit daunting. I learned to program on Emacs from the command line and I still prefer Emacs to just about any other code editor. It's powerful, easy to use, easy to customize, and it comes free with Mac OS X just as Vim does. Also, just like Vim, if you prefer to see your code in color, you'll need to turn on syntax highlighting by hand.

To turn on syntax highlighting in Emacs, you'll need to type M-x global-font-lock-mode once you've started the application. (Note: By M-x, I mean to use a combination of the Meta key and the x key. For the Mac, the Option key or the Escape key can act as the Meta key while in Emacs.) Otherwise, if you like to open your editor with syntax highlighting already turned on, you can add (global-font-lock-mode 1) to the .emacs file in your home directory. Make sure you include the surrounding since Emacs uses a version of the Lisp language, called elisp, for configuration and scripting.

If you've added the global-font-lock-mode line to your .emacs file and syntax coloring still doesn't seem to be working, it may be because you forgot to add the .py extension to your file and you've left out the optional she-bang line at the top of your script, thus the editor has no way of knowing that you just opened a Python file. The same is also true for Vim. You should be able to remedy the problem, however, by either adding the she-bang line to the top of your script telling the shell which program is used to run the script, or by adding the .py extension to your file's name. If you choose the former option, the she-bang line should look something like this: #!/usr/bin/python. Where, /usr/bin should be replaced with the path to the Python executable on your system, which you can find by typing in which python in the Terminal application.

However, if you have your .emacs file setup correctly and you also have the appropriate extension and/or she-bang line and yet Emacs still does not work correctly, it may be because you don't have a definition for a python-mode on your system. You may need to download an elisp file that defines the python-mode and install it. To do so, download python-mode.el from at and add the following lines to your .emacs file in your home directory. (Note: make sure to use the correct path to the location of your python-mode.el file in the load-file command, rather than the one I've supplied here.)

Listing 2: Adding python-mode to Emacs

.emacs file

The following lines create a variable that holds the location of the python-mode.el file, loads the new mode into Emacs, and associates the .py extension with that mode.

(load-file "/sw/lib/python2.3/Misc/python-mode.el")
(autoload 'python-mode' "python-mode" "Python mode." t)
(add-to-list 'auto-mode-alist '("\.py" . python-mode))

Now, I realize that not everyone enjoys using command line editors. Many programmers have grown up in a Windows environment where the idea of doing any serious work from the command line is laughable. To those of you who feel this way, I would like to suggest that you still consider giving these command line editors a try. Remember, your working with an interpreted scripting language when working with Python, and for that reason, you will find yourself wanting to use it for several small throwaway programs that will quickly run from the command line to accomplish a task or two and then be destroyed. When writing quick and disposable programs, I find it's generally fastest to develop from the command line rather than resorting to a full IDE. That said, it's not a bad idea to use an IDE when developing larger, more complex programs rather than quick scripts. For those of you who wish to use a complete IDE for those tasks, I've listed a few choices below.

Boa Constructor

Probably the most popular and most powerful Open Source IDE for Python (at least of the IDEs that work on OS X) is the Boa Constructor IDE. This program is a fully loaded IDE, with project management and a RAD tool for generating GUI code (wxPython code only). But, as good as that sounds, I did find a few problems when working with it.

First, I found it to be a little slow and unresponsive. I'm running this program on a G4, 1.25Mhz PowerBook with 1GB of RAM, and yet it still feels a bit sluggish. So, I don't see this as being a productive environment for anyone not running on a top-of-the-line Mac (preferably a G5-based PowerMac).

Second, the way the GUI was constructed disturbed me a bit. Basically, you had three main windows when starting a project, all of them disconnected from the other. So while you were working in the main editor window, the rest of the windows would gray themselves out and move to the back. This made it feel like three separate programs rather than one. There may be some way to resolve this, by turning on docking or something, but I was unable to find a way and it just left me frustrated.

Finally, Boa Constructor is written in Python using the wxPython GUI toolkit, which was our reason for download and installing the wxPython library in the last section. However, Boa Constructor does not work with the latest release of wxPython, which at this writing was v2.5.2.8. Instead, you have to download and install v2.4.2.4 of the wxPython GUI library (just as we all did during the introduction) in order to run the IDE. This is of course a minor setback and I believe that work is currently being done to update Boa to the newest release of wxPython, but for the time being you're stuck with the previous version and it is a bit annoying.

Figure 1 - The Boa Constructor IDE

In short, Boa is about the only choice you have if your looking for a full-fledged, batteries included IDE written specifically for Python, with a RAD tool and all. However, with its sluggish response and unfriendly UI, I find myself reticent to recommend it to anyone just yet. I simply feel that it's not quite ready for prime time.

Nevertheless, if you're running a top-of-the-line machine with plenty of memory and clock cycles to spare and you want a full and powerful IDE, you may as well give it a try (after all, it is free). But, for the rest of us without the means to by a dual processor PowerMac G5, I'll press on and discuss some editors that I do find worthy of looking into a bit closer.

Wing IDE

If you're looking for an IDE that's developed specifically for Python and runs like a professional tool should, then you can look no further than Wingware's Wing IDE. In the previous section I said that Boa was probably the most powerful IDE that I'll cover in this article. Well, personally I prefer the Wing IDE to Boa, and I find it to be nearly as powerful as the Boa IDE. However, one area in which the Wing IDE falls just a bit short of the Boa IDE is in its exclusion of a RAD tool for GUI development. With that said, I do believe that what the Wing IDE does better than Boa, and for that reason I prefer it to Boa, or for that matter, to any of the other IDEs I've tried for Python. Plus, if you absolutely must have a RAD tool, you can always use the Wing IDE in conjunction with the wxGladeOSX GUI designer that we'll be taking a look at shortly. But, before we get to our free RAD tool, let's take a closer look at Wingware's Wing IDE.

During the time that I spent with the Wing IDE, I found it to run smoother, look better, and just feels a bit tighter than the Boa Constructor IDE. Wing IDE has code completion (one of my big requirements when using an IDE) that actually works, in other words, it helps you code rather than get in your way. Nevertheless, Wingware's IDE does have a few problems that I'll go over in the next few paragraphs.

First, the application utilizes X windows for its window management, so it will need X11 (or some other implementation of X windows) to run. Though I prefer to run my applications in Apple's native Aqua look and feel rather than using X11, the IDE still looks really great. Unlike most programs using X, it actually looks as if belongs on OS X.

Second, just like Boa Constructor, the Wing IDE was developed with Python and wxPython, and just like Boa Constructor, it runs a little slow. Surprisingly though, this one doesn't run nearly as slow as I would have expected considering the complexity of the program and of course the fact that the program is being actively interpreted rather than ran as a precompiled executable. So, while it is definitely slower than say, a compiled Objective-C program using Cocoa, it's not so slow as to make it unusable.

Third, the project management features seemed a bit clumsy when compared with other IDEs I've used. For example, when I created a new project, I was not presented with a wizard to choose the location and name of my new project, as is the case with most IDEs. Instead, I had to choose Save Project As... from the Project menu--after I had already created the project--and rename the project and choose its location. Plus, you'll need to create a folder for your new project as well, otherwise you'll find your files scattered all over the directory in which you created the project. Also, when adding a file, you're confronted with the same scenario as when creating a project. Once again, you must choose Save As...from the Project menu to designate a name and location for the file--after you've already created it--and you have to run through the entire directory structure again to place it in the same location as the project rather than the default being to place the file in the project's folder. Once you've created your file, named it, and chosen its location, it is still not yet part of the project. You must choose Add File... from the Project menu to finally add the new file to your project. None of this is especially hard to do, but it's not the most intuitive or efficient process and it's definitely not a very user-friendly design.

Finally, the Wing IDE, unlike all of the other editors and development environments I'll mention in this article, is not free. Luckily, it doesn't cost very much for a hobbyist just wanting a decent IDE on which to develop their Python applications. In fact, as of this writing, the personal edition of the IDE could be purchased for $35, and if you definitely must have an IDE, I see no reason why the Wing IDE couldn't fill that void for you.

Figure 2 - The Wing IDE

All in all, this is probably my favorite of the IDEs developed specifically for the Python programming language. I wish it ran just a bit faster, and it would be nice to see someone develop a Cocoa based Python editor, but until that happens, I would recommend this IDE to anyone searching for a nice Python development tool. Plus, you can download it and try it out, fully functional, free of charge for up to ten days. So, why not take it out for a spin and make your own judgment call on whether or not it's worth the money.

Eclipse With PyDev

Eclipse is many things: a generic development environment, Java IDE, platform for tool development, GUI library--the list goes on and on. In fact, Eclipse is so large that several publishers have released entire books on just using it effectively. For our purposes though, we can just think of Eclipse as an IDE that can accommodate any language for which an extension has been developed. Python happens to be one of those languages, and PyDev is the name of the extension that provides Eclipse with the ability to grok Python.

PyDev tags itself as a complete development environment for Eclipse. It consists of three plugins. The first is the editor plugin and it supplies the user with helpful features such as syntax highlighting, smart indentation, and a whole list of the usual suspects. It claims to support code completion and refactoring as well, however, in my tests I found both of these features to be somewhat buggy. One feature of the editor plugin that I did find to be very helpful was its ability to capture syntax errors on the fly. For instance, if I tried to concatenate two strings, but I accidentally left out the '+' sign, the variable containing the second string would be underlined with a squiggly red line (reminiscent of most word processor's spell checking feature) to alert me that my syntax was incorrect and that the interpreter was expecting something other than just two operands, one right after the other.

The second plugin is the debugger. This plugin provides Eclipse with your typical code debugger, providing the user with a way to step through their code using breakpoints and look at variable values and so forth.

The third and final plugin of the PyDev development environment is the help plugin. This supplies the user with some brief, Eclipse style, documentation for PyDev.

With regards to being a proper development environment, the PyDev and Eclipse combination seems to be a formidable solution. If you're dead set on using an IDE to develop your Python applications rather than a code editor like Emacs or Vim, and yet you don't want to spend the money to purchase the Wing IDE, then I would recommend this one over any of the others I've reviewed in this article. I haven't worked with this setup for very long (as I said earlier, my favorite environment is Emacs right now) but I have used Eclipse quite extensively in the past with Java (in fact, Eclipse is my IDE of choice when doing Java development) and I have found it to be a very good IDE. Plus several major companies in the software industry have been trying to standardize on Eclipse for their IDEs. You know when companies such as IBM and Wind River (creators of the popular embedded OS VxWorks) are using Eclipse that it must be a good environment.

The main thing to remember is that PyDev is currently in version 0.8 (it has not yet reached version 1.0), and as such, it is still in its beginning stages. So, it's a little rough around the edges. Nevertheless, what it does well (with the exception of features that are still in their infancy), but it does need some polish before it will feel like a fully functional Python development environment.


Finally, I want to go over a couple of ways that you can make use of Apple's Xcode in your Python development. If you choose to go with this option you'll find that you have two schools of thought: 1) you can create pure Python applications (i.e., cross-platform, not dependent on Cocoa), or 2) you can create OS X native applications using PyObjC with Cocoa. We'll first cover creating and running a platform-independent, pure Python application, and then we'll look into what PyObjC is, and what it can do for us.

When playing around with Python one day, I finally reached a point when I thought; hey, wouldn't it be great to develop in Xcode. After all, I've done some development with Xcode, mainly just teaching myself AppleScript, but I was, nonetheless, quite impressed with the environment. It was fast and efficient and, unlike other IDEs, it didn't get in my way when I was programming. So, I started searching the web for a way to setup Xcode for Python development other than just using the PyObjC bridge to develop Cocoa based applications. After a bit of looking, I eventually stumbled across a site called pyx (Python on OS X) and it had some directions for setting up Xcode for this very task. In the next couple of paragraphs I'll share with you a quick summary of the information I garnered from that site. (By the way, the webiste's URL is, it's worth a look every now and then to see if any new and useful information has been reported.)

First, let's start off with developing a Python command line application. The process is pretty simple. You basically just need to setup an empty project (since Xcode does not directly support Python development) and create a custom executable to run your application. So, if you follow the steps I've detailed below, you'll be up and running in Xcode in not time.

    1) Choose File->New Project to create a new Xcode project

    2) Make sure you select Empty Project as the type of project to create

    3) Choose where to save the project, name it, and click Finish

    4) Add your main file to the application

    5) Choose Project->New custom executable

    6) Name your custom executable and type in the path to the python executable on your system (you can type which python in the terminal window to get this information)

    7) Double click on the custom executable you created to open its main information window.

    8) Click the arguments tab and click the '+' button to add a new argument to the list.

    9) The new argument should be the complete path to the main file of your application (you can either find this path using Finder or the Terminal application)

    10) Choose Debug->Run Executable or Press opt-command-r to run the application.

Running a Python application that uses the Window Manager is essentially the same as running one from the command line, however, we need to tell Xcode to use pythonw instead of python (pythonw is needed to run a Python script that makes use of the Window Manager, i.e., a GUI-based application). This is where we run into a small problem. It seems that Xcode only wants to run a binary executable, which python is, and pythonw most definitely is not. Since pythonw is a simple shell script we can run it by passing it and the file we wish to execute as arguments to the sh program. Using this method, our new executable path should look something like the following: /usr/bin/sh /usr/bin/pythonw /path_to_main_file/

Another way that we can run our GUI-based application is to put the full path to the executable that is referenced within the pythonw script into the executable path of our custom executable that we created in our Xcode project. If you prefer this method, you'll first need to get the location of the pythonw script, which you can do by typing which pythonw into a Terminal window. Once you've got the location of the pythonw script, you'll need to open the script with your favorite editor or display the contents of the script with the cat program and copy and paste the full path to the Python executable from the pythonw script into the executable path of the custom executable we created to run our application. Once you've done this, you'll be able to run your GUI-based Python programs directly from Xcode.

If you like Python and you don't really care to create platform agnostic applications, you may find that developing Python applications with PyObjC is the most logical environment for you. PyObjC is an Open Source project that provides a bidirectional bridge between Python and Objective-C. Thus, Python programmers have a way of accessing the classes of Apple's Cocoa Framework through this bridge. One of the most important uses of this is to provide the Python programmer with access to the Cocoa GUI classes allowing him/her to write OS X native, GUI-based applications in pure Python.

My experience with PyObjC has been promising, though I still believe that it needs a few more iterations before reaching the usability I prefer in a development environment. For example, I wish it were possible to generate the python files from Interface Builder as you can for Java and Objective-C rather than going to the command line to do so. Small gripes such as this aside, I did enjoy developing applications using PyObjC. I found it to be very usable, very stable, and very easy to install. In fact, binary installers are available for both Jaguar and Panther editions (v10.2 and v.10.3) of OS X and can be downloaded from the projects main website [].

If you're planning on developing applications for other platforms as well as OS X, then obviously this is not the option you should go with. However, if you enjoy programming in Python and you're looking for a way to use it to develop OS X native applications, or if you're just looking for an alternative to Objective-C, then PyObjC may just be perfect you.


Before we close out our discussion of code editors and IDEs, I wanted to go over one final option that is neither code editor nor IDE, but it does seem to fall into a similar category. The wxGlade designer is a RAD tool that can be used to design GUIs for your Python applications using the wxPython library.

The application was created using Python and the wxPython GUI library. It can be used to rapidly construct a graphical interface using the drag-n-drop methodology that other popular RAD tools use. Once the GUI is completed, wxGlade will output the code used to create the GUI. This code can then be plugged into your application and you can then go about adding the code that does the actual work saving you countless hours writing the code that creates the applications GUI.

The designer isn't just limited to producing code for Python, however. The wxGlade GUI designer also produces wxWidgets code for the C++ and XRC (an XML based code format) languages as well. This means that, should you ever become interested in using your knowledge of wxWidgets to develop cross platform applications based on another language such as C++, (say, if more speed is needed) then you'd already have the ability to do so. So, basically more bang for the buck--nice, eh?

The wxGlade GUI designer was based upon Glade, the GTK/Gnome GUI Builder. It's definitely not the most intuitive GUI development tool to use, so it will take a bit of training to become an expert with it, but it's free, and once learned, it does speed up the process of writing a GUI quite a bit. Also, it has a very simple install since a binary (called wxGladeOSX) has been created and can be found at the WordTech website [].

Figure 3 - wxGladOSX With Code Displayed in XEmacs


As the title would suggest, this article was meant to be a very gentle introduction to the Python language and to what Python has to offer Macintosh developers. Hopefully, if I've succeeded in my job, you'll come away from this article with an interest in learning Python and you'll be armed with a whole slew of development environments to aid you in the process. If this is the case, make sure that you tune in for my second article, which promises to probe deeper into the tools available to the Python developer on OS X.

Unlike this month's article which was geared towards Python newbie's, next month's article will be geared to those of you already employing Python in your development routine. Those of you who fall into this group, will be introduced to several libraries that will make your use of Python easier and more effective.

So, until then my new Pythoneers--best wishes in your Python development, and happy scripting.

Bibliography and References

Graham, Paul "Great Hackers" May 2003, (15 Nov. 2004).

Graham, Paul "The Python Paradox" Aug. 2004 (15 Nov 2004).

Christopher Roach recently earned his MS in Computer Science from Virginia Tech and currently works as a software engineer in Florida's Space Coast. On the weekend he tries to find time to write articles on Macintosh programming and do battle with insanely powerful hurricanes, while still trying to preserve some semblance of a life. If you have questions or comments on the article, you can email him at


Community Search:
MacTech Search:

Software Updates via MacUpdate

Logic Pro X 10.3 - Music creation and au...
Logic Pro X is the most advanced version of Logic ever. Sophisticated new tools for professional songwriting, editing, and mixing are built around a modern interface that's designed to get creative... Read more
iMazing 2.1.8 - Complete iOS device mana...
iMazing (was DiskAid) is the ultimate iOS device manager with capabilities far beyond what iTunes offers. With iMazing and your iOS device (iPhone, iPad, or iPod), you can: Copy music to and from... Read more
Civilization VI 1.0.2 - Next iteration o...
Sid Meier’s Civilization VI is the next entry in the popular Civilization franchise. Originally created by legendary game designer Sid Meier, Civilization is a strategy game in which you attempt to... Read more
TurboTax 2016 - Manage your 2016 U.S. ta...
TurboTax guides you through your tax return step by step, does all the calculations, and checks your return for errors and overlooked deductions. It lets you file your return electronically to get... Read more
Microsoft Office 2016 15.30 - Popular pr...
Microsoft Office 2016 - Unmistakably Office, designed for Mac. The new versions of Word, Excel, PowerPoint, Outlook and OneNote provide the best of both worlds for Mac users - the familiar Office... Read more
FotoMagico 5.3 - Powerful slideshow crea...
FotoMagico lets you create professional slideshows from your photos and music with just a few, simple mouse clicks. It sports a very clean and intuitive yet powerful user interface. High image... Read more
Acorn 5.6.1 - Bitmap image editor.
Acorn is a new image editor built with one goal in mind - simplicity. Fast, easy, and fluid, Acorn provides the options you'll need without any overhead. Acorn feels right, and won't drain your bank... Read more
Dash 3.4.3 - Instant search and offline...
Dash is an API documentation browser and code snippet manager. Dash helps you store snippets of code, as well as instantly search and browse documentation for almost any API you might use (for a full... Read more
Microsoft Remote Desktop 8.0.37 - Connec...
With Microsoft Remote Desktop, you can connect to a remote PC and your work resources from almost anywhere. Experience the power of Windows with RemoteFX in a Remote Desktop client designed to help... Read more
Macs Fan Control - Monitor and c...
Macs Fan Control allows you to monitor and control almost any aspect of your computer's fans, with support for controlling fan speed, temperature sensors pane, menu-bar icon, and autostart with... Read more

ReSlice (Music)
ReSlice 1.0 Device: iOS Universal Category: Music Price: $9.99, Version: 1.0 (iTunes) Description: Audio Slice Machine Slice your audio samples with ReSlice and create flexible musical atoms which can be triggered by MIDI notes or... | Read more »
Stickman Surfer rides in with the tide t...
Stickson is back and this time he's taken up yet another extreme sport - surfing. Stickman Surfer is out this Thursday on both iOS and Android, so if you've been following the other Stickman adventures, you might be interested in picking this one... | Read more »
Z-Exemplar (Games)
Z-Exemplar 1.4 Device: iOS Universal Category: Games Price: $3.99, Version: 1.4 (iTunes) Description: | Read more »
5 dastardly difficult roguelikes like th...
Edmund McMillen's popular roguelike creation The Binding of Isaac: Rebirth has finally crawled onto mobile devices. It's a grotesque dual-stick shooter that tosses you into an endless, procedurally generated basement as you, the pitiable Isaac,... | Read more »
Last week on PocketGamer
Welcome to a weekly feature looking back on the past seven days of coverage on our sister website, PocketGamer. It’s taken a while for 2017 to really get going, at least when it comes to the world of portable gaming. Thank goodness, then, for... | Read more »
ROME: Total War - Barbarian Invasion set...
To the delight of mobile strategy fans, Feral Interactive released ROME: Total War just a few months ago. Now the game's expansion, Barbarian Invasion is marching onto iPads as a standalone release. [Read more] | Read more »
Yuri (Games)
Yuri 1.0 Device: iOS iPhone Category: Games Price: $3.99, Version: 1.0 (iTunes) Description: It's night. Yuri opens his eyes. He wakes up in a strange forest.The small, courageous explorer rides on his bed on casters in this... | Read more »
Space schmup Xenoraid launches on the Ap...
10Tons Xenoraid is out today on the App Store, bringing some high-speed space action to your mobile gadgets just in time for the weekend. The company's last premium title, another sci-fi game titled Neon Chrome, did quite well for itself, so... | Read more »
Star Wars: Force Arena Beginner's G...
Star Wars: Force Arena joined the populous ranks of Star Wars games on mobile today. It's a two-lane MOBA starring many familiar faces from George Lucas's famed sci-fi franchise. As with most games of this nature, Force Arena can be a little obtuse... | Read more »
Mysterium: The Board Game (Games)
Mysterium: The Board Game 1.0 Device: iOS Universal Category: Games Price: $6.99, Version: 1.0 (iTunes) Description: The official adaptation of the famous board game Mysterium! | Read more »

Price Scanner via

Laptop Market – Flight To Quality? – The ‘Boo...
Preliminary quarterly PC shipments data released by Gartner Inc. last week reveal an interesting disparity between sales performance of major name PC vendors as opposed to that of less well-known... Read more
IBM and Bell Transform Canadian Enterprise Mo...
IBM and Bell Canada have announced they are joining forces to offer IBM MobileFirst for iOS market-ready enterprise applications for iPad, iPhone or Apple Watch. Bell, Canada’s largest communications... Read more
Otter Products is Closing… For a Day of Givin...
On Thursday, Feb. 9, Otter Products is closing doors to open hearts. In partnership with the OtterCares Foundation, the company is pausing operations for a day so all employees can volunteer with... Read more
15-inch 2.2GHz Retina MacBook Pro on sale for...
Amazon has 2015 15″ 2.2GHz Retina MacBook Pros (MJLQ2LL/A) available for $1799.99 including free shipping. Apple charges $1999 for this model, so Amazon’s price is represents a $200 savings. Read more
Back in stock: Apple refurbished 13-inch Reti...
Apple has Certified Refurbished 2015 13″ Retina MacBook Pros available for up to $360 off original MSRP, starting at $1099. An Apple one-year warranty is included with each model, and shipping is... Read more
CalcTape for macOS 1.2 Adding Machine App for...
schoettler Software has announced CalcTape 1.2, an update to their desktop calculator for macOS. When it comes to adding long columns of numbers, doing complex calculations or playing around with... Read more
New MacBooks And MacBook Pros WIth Kaby Lake...
Digitimes’ Joseph Tsai cites a Chinese-language Economic Daily News (EDN) report that unnamed market watchers are predicting Apple MacBook shipments to grow 10 percent in 2017, and projecting 15... Read more
New 2016 13-inch MacBook Pros on sale for up...
B&H Photo has the new 2016 13″ MacBook Pros in stock today and on sale for up to $150 off MSRP. Shipping is free, and B&H charges NY sales tax only: - 13″ 2.9GHz/512GB Touch Bar MacBook Pro... Read more
New 15-inch Touch Bar MacBook Pros in stock a...
B&H Photo has the new 2016 15″ Apple Touch Bar MacBook Pros in stock today and on sale for up to $150 off MSRP. Shipping is free, and B&H charges NY sales tax only: - 15″ 2.7GHz Touch Bar... Read more
Opera Announces Neon Concept Browser For Mac
Opera is inviting users to get a glimpse of what Opera for computers could become with its Opera Neon browser concept. Each Opera Neon feature is described as “an alternate reality” for the Opera... Read more

Jobs Board

*Apple* Retail - Multiple Positions (Multi-L...
Job Description: Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, Read more
*Apple* Retail - Multiple Positions - Apple,...
Job Description: Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, Read more
*Apple* & PC Desktop Support Technician...
Apple & PC Desktop Support Technician job in Stamford, CT We have immediate job openings for several Desktop Support Technicians with one of our most well-known Read more
*Apple* macOS Systems Integration Administra...
…most exceptional support available in the industry. SCI is seeking an Junior Apple macOS systems integration administrator that will be responsible for providing Read more
*Apple* Premier Retailer - Service Technicia...
DescriptionSimply Mac is the largest premier retailer for Apple products and solutions. At Simply Mac we are all Apple , all the time. Same products. Same prices. Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.