Yesterday I tried Aptana Studio 3 and I’m impressed. My preferred IDE was Eclipe with the PyDev plugin. The good news is Aptana Studio is built on Eclipe, but it contains lots of useful plugins preinstalled (PyDev is among them). So it feels like a tuned up Eclipse :)
I think I will use Aptana from now on for larger projects. And it’s free, of course.
For text editing I use vim. When writing Python code and the script is short, vim is OK. However, if it’s a larger project, then I prefer an IDE (PyDev for instance).
If you want a tuned up Eclipse-Pydev, try Aptana Studio.
- Download Eclipse. You can get the IDE for Java Developers.
- Add the plugin PyDev using the repository http://pydev.org/updates.
- Since the new Ubuntu 11.04 uses Python 2.7 by default, you can tell Eclipse too to use it instead of version 2.6. Go to Window -> Preferences, then Pydev -> Interpreter – Python. Remove Python 2.6 and add Python 2.7.
Now if you want to create a new Python project, choose New -> Pydev Project.
Pydev has lots of cool features. My favorites:
- code completion (CTRL + Space)
- Rename (Shift + Alt + R), which works through projects too! Say, you have two projects, A and B. A is a library that is used by B. If you reference A from B correctly then if you rename something in A, PyDev will rename the necessary references in B too. I find it very useful when doing refactoring and trying to find better names for functions/variables.
- debugger (F11)
- jump around (hold CTRL and left click with your mouse on a function name to jump to the function’s definition)
With PyDev, I get “unresolved import” errors quite often, even if the import is correct and the script runs fine. Here I found some tips how to get rid of them:
- Click Ctrl + 1 and select “Unresolved import error”. This will hide the error.
- Under Preferences -> PyDev -> Editor -> Code Analysis, go to the Imports tab. Change Import redefinition from “Error” to “Warning”. I don’t recommend “Ignore” because it will hide the real errors too.
For more tips, refer to this post.