Python Editors

From Sfvlug

Until we can get around to reviewing all the available editors and IDEs and you just want to get started, you may already have everything you need already on your system. Please see the section on IDLE. If you want something a bit more graphical most standard text editors for the Gnome and KDE desktop environments will serve quite well and may even have some Python specific editing features like code highlighting. With most of these types of editors you will need to save your work then run the code manually in a shell. Because Python is an interpreted language you can run your code directly at a command prompt like this:

$ python myscript.py

or to remain in an interactive Python shell

$ python -i myscript.py

You can learn quite a bit from an interactive shell without using an editor.

For those who can't wait until we get around to more detailed and specific reviews beyond IDLE please visit The Python Programming Language Official Website for an overview of editors and IDEs.


IDLE

IDLE is the Python IDE written in Python using the Tkinter GUI toolkit and works on all platforms that support Python. IDLE calls itself, Python's Integrated DeveLopment Environment and is named in accordance to the spirit of Python with a reference to the British television show, Monty Python's Flying Circus. A stable version of IDLE is currently distributed with every Python distribution. So, if your system has Python installed you should already have IDLE available for your use.

It is fairly simple and consists of separate editor and Python shell windows. Using IDLE is similar to running a Python shell from a terminal window and editing the script in another terminal window using Vim, Emacs or your favorite text editor not requiring a GUI. For quick one or two liners where you don't need to save your script the IDLE Python Shell is all you will need. If you want to save your script or it involves more complicated code you will probably want to use the editor. You can run your script directly from the Python Editor but if you haven't already saved it you will be prompted to save your script before it will be run in the Python Shell.

IDLE shell & editor

The IDLE Python Editor The editor can be configured to use default or user defined highlighting, key bindings, fonts, indentation and a few general settings. The editor also supports call tips, code completion, word expansion, show and matching parenthesis.

The IDLE Python Shell The Python Shell can also be configured with the same options available to the editor. It also includes some debugging options not availible in the editor alone. One nice thing about the shell that is not the case with all Python development tools is that it remains interactive after the script is run.

Open Module From the editor or shell menu you can open a new editor window to take a look at the Python source code for any module written in Python.

Class Browser Opening a new window from the editor or shell using this browser lets you browse classes and functions. Clicking on a class or function will find and highlight that class or function in the editor. This is a handy tool when dealing with large complex programs.

Path Browser The Path Browser lets you find and open Python programs and modules in your system path. This will not find Python programs and modules tucked away in a subdirectory not in your system path. An example is it being able to find /home/user/bin/myscript/myapp.py but not /home/user/Desktop/myapp.py assumning that you have /home/user/bin and you have included it in your $PATH.

Debugger The IDLE debugger is real simple and far from complete. It allows you to set breakpoints, view and step.

It is possible to extend IDLE if you need tools not included in the stable version that came with your Python distribution, but you might want to look into some other editors or IDEs first.

While comparitively not real powerful or versitile this IDE is a good choice for beginners just because it is basic and simple. It can certainaly get you through most if not all beginning to intermediate tutorials.


http://hkn.eecs.berkeley.edu/~dyoo/python/idle_intro/index.html provides a beginning introduction to using IDLE and while the examples and images are from Windoze the look and feel are almost identical under *nix.

http://www.python.org/doc/current/lib/idle.html This page is from the Python Library Reference is definately for reference only and not a tutorial, however, it might be the right place to find info on an esoteric fact.

http://www.python.org/idle/doc/ Also not a tutorial but provides a lot more usable info than the reference library and is easier to read. It is available in frames or no frames versions.

Your Ad Here
Personal tools