Hands-On Software Engineering with Python
上QQ阅读APP看书,第一时间看更新

IDLE

IDLE is a simple IDE, written in Python and using the Tkinter GUI, which means that it should run on pretty much anything that Python can run on. It is often, but not always, part of a default Python installation but even when it's not included by default, it's easily installed and doesn't require much of anything in the way of external dependencies or other languages runtime environments.

  • Large-project support: Poor
  • Refactoring support: Poor
  • Language exploration: Good
  • Code execution: Good
  • Bells and whistles: Fair

Out of the box, IDLE doesn't provide any project management tools, though there may be plugins that provide some of this capability. Even so, unless there are also plugins available that allow for more than one file to be open at a time without requiring each to be in a separate window, working with code across multiple files will eventually be tedious, at best, and perhaps impractical to the point of being effectively impossible.

Although IDLE's search-and-replace functionality includes one nice feature – regular expression-based searches – that's about it as far as functionality that is meaningful or useful for refactoring purposes. Any significant refactoring effort, or even widespread but smaller scoped changes, will require a relatively high degree of manual effort.

Where IDLE really shines is in its ability to dig into the packages and modules available on the system. It provides both a class browser that allows direct exploration of any importable namespace in the Python path, and a path browser that allows exploration of all available namespaces. The only downsides to these are a lack of search capability and that each class browser has to reside in a separate window. Were these not concerns, a Great rating would not seem out of line.

IDLE allows any open file to be executed with a single keystroke, with the results/output of that run displayed in a single, common Python shell window. There is no facility for passing arguments to those executions, but that's probably only a concern if a project involves some sort of command-line program that accepts arguments. IDLE also provides a syntax check that identifies the first syntax problem detected in the code, which could be of some use.

The only reliably functional bells and whistles item that IDLE offers is coloration of code. There are extensions that are supposed to provide things such as auto-completion and some code authoring assistance (automatic generation of closing parenthesis, for example), but none of them appear to be functional.

The following is a screenshot of IDLE showing the console, a code editing window, class and path browser windows, and a search and replace window:

IDLE is probably a reasonable choice for small code efforts – anything that doesn't require having more files open than the user's comfortable with having displayed in their individual windows. It's lightweight, with a reasonably stable (if occasionally quirky) GUI. It's not something that feels like it would work well for projects that involve more than one distributable package, though.