InfoWorld review: Nine fine Python development tools
A wide-ranging flock of Python IDEs offer great options for Windows scripting, GUI applications, Web frameworks, multilanguage development, and more.
Nine fine Python development tools: Pydev
Aptana's Pydev is an Eclipse plug-in that supports development in Python, CPython, Jython, or IronPython. I tested version 1.5.9, running in a Galileo release of the Eclipse IDE. The version I explored will work with both the new Python 3.x as well as the earlier Python 2.x.
Installation is easy with the help of the Eclipse update mechanism. Just connect to the proper repository, select the Pydev install, and Eclipse does the rest for you. If you're already familiar with Eclipse, you'll have no trouble getting Pydev installed or finding your way around the capabilities Pydev includes.
Eclipse refers to a particular configuration of windows as a perspective. Two perspectives are important to Python developers: the Pydev perspective and the Debug perspective. You do your editing in the former; the latter is for running and debugging the application. When you install Pydev, you install three new project types: Pydev, Google Apps, and Django.
A Pydev project is merely a standard Python project; Google Apps and Django projects are created with special features and attributes appropriate for those two development frameworks. For example, if you create a Django application, Pydev automates a number of actions. You can launch a Python shell in the Django environment, issue a custom command, synchronize the Django database, and -- if you happen to be working with the Jython variant of Django -- create a WAR file.
As is standard for Eclipse, Pydev provides plenty of source editing customization features. For example, you can configure code folding so that it operates on while
statements but leaves try
statements unfolded. You can configure hovering so that placing the cursor over a method name displays docstrings. You can define similar customizations for the debugger (such as hovering over an in-context variable in the debugger will display its value in a pop-up). Pydev also installs plenty of templates and associates them with hotkeys. For example, select a function line in your code, click Ctrl+1, and a docstrings template is poured into the editor.
Pydev provides the expected Eclipse debugging arrangement. All the basics are there: breakpoints, watches, expressions, and so on. You can watch whole Python expressions. Select the code directly in the code editor by highlighting the snippet you're interested in, select "watch," and Pydev puts your chosen code fragment into the watch list.
Pydev supports debugging of multithreaded apps; it will also do remote debugging, but you have to do a bit of preparation beforehand. You must install a special remote debugging program in the Python path and ensure that the source files are on both source and target machines. Then you must edit the pydevd_file_utils.py file to map local paths to corresponding paths on the remote machine. It's tricky, but fortunately there's a section in the documentation that walks you through the process.
If you like scripting your development tools, Python accommodates with its Jython support. Because Eclipse is written in Java, you can actually script Pydev's operations -- in fact, you can script Eclipse itself -- with Jython code written with Pydev's help. (The 1.6.0 version, released just as I was finishing the review, includes an interactive console that accesses Eclipse's internals, making this process even easier.)
Documentation is not to be found within the product. What you will find is an apology, followed by the justification that the documentation was too difficult to maintain within Eclipse, and please go online for Pydev information. The documentation you'll find online is arranged well, but it's sparse. You'll find topics for getting started, configuring, building a project, and executing/debugging, as well as some information about working with Jython. But this is definitely an area where Pydev could use some improvements.
While Pydev does not have a GUI builder, its engineers point out that one really isn't needed. A Qt plug-in is available for Eclipse, which provides a GUI builder whose results are available to Python via PyQt. If you're already used to Eclipse, you'll figure out Pydev in a jiffy. Aptana has outfitted it with all the features you'll find in other Eclipse programming tools: code completion, hovering, refactoring. Pydev's other great strength is its ability to work easily with all the popular Python versions (the 2.x and 3.x branches) and variants (CPython, Jython, and IronPython).