Update: someone informs me that there's an
eclipse plugin, which seems obvious in retrospect. I stand by this since I think emacs is a better editor, but, for those who don't know emacs that surely makes more sense.
----
Another update: see
here.
----
I have recently been doing some coding in Python. (I am gradually becoming obsessed with it, actually.) Perhaps the thing I like most about it is the fact that it has such a good
interop story.
Getting myself to the point where I felt like I had an efficient development environment took a little while, though. I am not thrilled with IDLE (the python GUI that ships with the distribution), and I am trying to write portable code here so IronPython/VS.NET is not really an option.
So, here are the steps I followed to set up what is (in my opinion) a kickass alternative development environment for Python on Windows. This assumes very little knowledge and hopefully this will be helpful to somebody.
You will need:
Yes, tragically, you will have to learn emacs if you have managed to resist it up to this point. Luckily, it turns out to be worth the trouble.
Step 1 - Organizing
You can put these things wherever you want, but you must remember to make sure that python.exe is somewhere in your PATH. While you are at it you also should set a HOME environment variable so that emacs knows where to look for its startup file (.emacs).
I extracted the python-mode files to /lisp/progmodes/python-mode under my emacs folder.
Step 2 - Editing .emacs
Create a file called .emacs in the folder you chose as HOME in step 1 (there are actually a few different ways you can set this up, see
here). Add the following to that file:
(add-to-list 'load-path "[the path to the python-mode directory]")
(setq auto-mode-alist (cons '("\\.py$" . python-mode) auto-mode-alist))
(setq interpreter-mode-alist (cons '("python" . python-mode)
interpreter-mode-alist))
(autoload 'python-mode "python-mode" "Python editing mode." t)
(global-font-lock-mode t)
(setq font-lock-maximum-decoration t)
After doing that restart emacs.
Step 3 - Write Some Code
At this point you should have a working environment. When editing a .py file in emacs, you should see two related menu items--look there for the keyboard shortcuts or read the comments in the
python-mode source. The coolest one is C-c ! (that's ctrl+c, then !, for the uninitiated), which opens up the Python REPL in a buffer.
You should now have something looking like this:

Although, your colors won't be as cool as mine unless you follow:
Step 4 - Optional Stuff
The default emacs colors on Windows remind me of a tour of a plastic vomit factory I had back in the early 90s, so one of the first things I did when I started using it (for Lisp, a few months ago) was figure out how to change them. Download
color-theme and add this to your .emacs:
(add-to-list 'load-path "[the path to the color-theme folder goes here]")
(require 'color-theme)
(color-theme-initialize)
(color-theme-blue-mood) ; replace with whatever theme you want
I also switched the default font to
Consolas, which I have become quite fond of. Here is how you do that:
(set-default-font "-*-Consolas-normal-r-*-*-13-*-*-*-c-*-*-iso8859-1")
Which seems awfully arcane to me, but there you go. Good night and good luck.