I find that I only type 2 to 4 characters of any given keyword which drastically speeds up my coding.
Now that I have been spending time writing some Python code I find myself reaching for ctrl+space.
Are there any IDEs that support code completion in Python?
I do my python development on a Mac. So, an OS x tool would be preferable.
It seems like the doc string property of Python methods is a perfect match for inline API discovery.
Actually, PyDev plugin for Eclipse has a full support for code completion (try PyDev Extensions too). You can easily try it here [1]. Another editor worth mentioning is WingIDE [2], which is really powerful. For more on Python editors check this page [3].
I use Aquamacs [4] with ropemacs [5] on my Mac, but that's an ultra geeky setup :)
[1] http://easyeclipse.org/site/distributions/python.htmlThe free Komodo Edit [1] app from ActiveState includes code completion.
It's provided via XML files that detail the API(s) you are using.
It is cross platform and thus works on Windows, Linux and Mac.
[1] http://www.activestate.com/komodo%5Fedit/Vim's OmniComplete has the same fun intellitext-style popups and everything for auto completion.
As a further development of VIM's builtin pythoncomplete
,
jedi-vim
[2] really understands your Python code (like decorators, list comprehensions, etc). It's using the
Jedi
[3] library.
I have tried a lot of python IDE's and the best one I like is PyScripter [1]. Its easy to use and has nice code completion.
[1] http://code.google.com/p/pyscripter/Pycharm: http://www.jetbrains.com/pycharm/
Works pretty great for me. Of course code completion in python is not going to be as perfect as it is for static languages -- a variable can dynamically change at runtime into anything. But it beats the hell out of nothing.
Also if you set up your interpreter and site-packages paths correctly in the project settings, you can easily jump into the definition of a Python's library module py files, which is very helpful at times. Plus the completion helper reads functions docstrings.
It's also possible to turn VIM into a respectable Python IDE:
Turning Vim into a modern Python IDE [1]
[1] http://sontek.net/blog/detail/turning-vim-into-a-modern-python-ideI've written PySmell, a library that provides auto-completion to Emacs, Vim and TextMate, by taking the TAGS approach - generate tags for your code and other projects, and complete based on those.
It completes import statetements, and has some rudimentary type inferencing. I'm about to release v0.7 which supports all that.
Grab it from: http://code.google.com/p/pysmell/
IPython [1] is an almost complete interactive python shell with an integrated help system and tab completion for every live object and class.
So you just need an IDE that integrates well with IPython, such as PIDA [2] or Emacs [3].
[1] http://ipython.org/Komodo Edit [1] from the Open Komodo [2] project has the best auto-completion and code/text introspection I've ever seen on an editor - for python as well as a number of languages. It reads from your source, rather than requiring any particular configuration. (It even manages to be able to edit Bash, SQL and structured text files intelligently.) You can also attach libraries/modules to it, so you have documented access to them.
I would highly recommend the free Komodo edit.
[1] http://www.activestate.com/komodo%5Fedit/On Windows, PyScripter [1] is a pretty good free and open-source IDE that provides code completion (as well as debugging and other features). It doesn't really parse doc strings or other annotations, so it has limits to the completions that can be offered.
WingIDE [2] is a cross-platform (Windows, Linux, Mac) commercial IDE. It's pretty full featured and you can provide annotations in comments as hints to the intellisense. There's a free version of Wing, but I don't know if that contains that feature. A trial version is available for all the versions.
[1] http://code.google.com/p/pyscripter/I'm surprised no one has mentioned SPE ( pythonide.blogspot.com [1]). It has code completion not only with the python libraries but the code you write as well, it's not import only it will complete code in the same file as well. It also has a whole bunch of features like UML diagram tool, and pydoc generation.
[1] http://pythonide.blogspot.com/I ditched all of the below and only use Sublime Text [1] nowadays. It's really great, and has awesome Python support trough add-ons (and good support out of the box).
Here are some that I use frequently:
Eclipse
[5] (with
pyDev
[6]) is great. Personally I find it a bit overkill for mundane tasks. The more features, the more they distract you from getting things done.
Vim
[7] is my standard choice, it's powerful but the interface don't get in your way (check :help python
in Vim). There's also a nice
Tutorial
[8] on using Python with Vim.
Both are Open Source and got great Communities to get help.
But on Mac I would strongly suggest to check out TextMate [9], it's awesome (and got nice support for Python and Django). I use it at work and absolutely love it, it's powerful but not bloated and let you focus an your work. TextMate [10] is not Open Source though (if you care), and OS X only, so I stick to Linux and Vim at home.
Another slick and casual editor for Linux would be Scribes [11]. For those on Linux who find an IDE too bloated but Vim too complex, check it out, it is very minimalistic but got some nice features gEdit, Kate, etc. miss.
[1] http://www.sublimetext.com/I've found that Eclipse/PyDev's autocomplete feature more powerful than Komodo Edit's, but that's to be expected. Although I'm a big autocomplete fan, I still find myself using Komodo more because it does a much better job of staying out of your way when you just want to write a script.
There is a full Komodo IDE [1] from ActiveState which will allow you to debug and step through Python code as well as do the code completion. I use it at work for Perl and PHP development (it covers Perl, Python, Ruby, TCL and PHP) and it works really well. I use it on a PC, but I know it works for Macs as well. Of course, this one you have to pay for over the free Komodo Edit [2], but you do get a lot [3] for your money.
[1] http://www.activestate.com/komodo/To be really worthwhile the autocomple should read from your source, not just an API listing. It sounds like both Komodo and the Eclipse plugin do not support that. Is there any option that does?
I'm not sure how well this would transfer to a Mac, but adding auto completion is easy in linux.
In your .pystartup.py file, add the following lines.
import readline
readline.parse_and_bind("tab: complete")
del readline
WingIDE (www.wingware.com) is by far superior in terms of code completion and being "Python-aware" in general to any Python editor or IDE out there (I've looked at PyDev, Komodo, and others mentioned here). WingIDE is not free, but being under $200 for a full-blown single-user version makes it easy to talk even the cheapest manager into the purchase. Take it for a free trial first and experiment with all the options. I've used it for about 3 years now and would not think of writing/debugging Python code without it.
I use TextMate [1] on my Macintosh. With the Python/Django bundles it's very usable (and mac-like, which is important to me... emacs/aquamacs/xemacs make me context-switch from the rest of my applications).
[1] http://macromates.com/Actually PyDev [1] is worth while and I've found it to be the best of all the editors for Python. It seems though, that Pydev extensions [2] (which are nonfree) would make the perfect couple. Too bad that these aren't free (autoimport and other stuff from PyDev extensions are really nice).
Two other editors I've been using with python so far are Eric [3] and UliPad [4](mostly on slower computers). Vim [5] is also great, but I couldn't get it to autocomplete on Windows somehow :-(
[1] http://pydev.sourceforge.net/Emacs and vim both have autocomplete.
The rlcompleter module deserves special mention here. It's not specific to an IDE, but it does provide tab code completion in Python's interactive mode...very handy.
https://docs.python.org/library/rlcompleter.html
Eclipse will do it, but only for imported objects. Sadly not for objects in your own source.
@Leon Yes, Komodo Edit is available for the Mac as well as for Windows. In fact, I use it on both platforms, and I'm extremely happy with it.
One thing to keep in mind: it's not a full blown IDE. It's more of a text editor with some project features and good syntax highlighting and code completion. If you're looking for something as beefy as Eclipse or Visual Studio, Komodo Edit may seem a little stripped down. On the other hand, Komodo is really, really easy to find your way around and doesn't have nearly the mental overhead of learning a new IDE like Eclipse.
I personally love Komodo Edit and recommend giving it a whirl.
Eric Sipple
edit: One other thing about Komodo Edit if you're used to Visual Studio (like I was when I started using it). Its code completion requires you hit Enter/Return to finish what you're writing, unlike Visual Studio. I find myself hitting the wrong key for the first couple of lines of code if I fire up Komodo after getting home from work.
Here you can find a complete list of editors for Python:
PythonEditors [1]
For me, the best editor is PyDev in Eclipse. Especially the debugging is nice.
[1] http://wiki.python.org/moin/PythonEditorsBoa Constructor [1] is free, OpenSource and developed in Python + wxPython. It supports auto completion pressing Ctrl+Space, works OK for me.
[1] http://boa-constructor.sourceforge.net/Not an OSX editor, but for those working with IronPython on Windows, there is a community maintained edition of Visual Studio available configured for working with IronPython and providing full Windows Forms and WPF designer support.
It can be accessed from its home on CodePlex [1].
[1] http://www.codeplex.com/IronPythonStudioeric4 does the job very well for me: http://eric-ide.python-projects.org/
pydev plugin for Eclipse is the best option for now !! Also since it is an open source project you can extend it if you didnt like any feature
The best editor for the Mac IMO is TextMate [1]. It's got a python bundle that will do what you're looking for. It's got bundles for a zillion other languages as well.
Well worth the price.
[1] http://macromates.comI have heard (disclaimer: I have no personal experience with it) that the Python editing for NetBeans, done to support Jython, has nice code completion and other features.
Here's a link to a relevant post on multi-lingual NetBeans [1] by Tor Norbye, a NetBeans wizard.
[1] http://blogs.oracle.com/tor/entry/multilingual_netbeansTry Eric IDE [1] I quite enjoyed using it.. am back to vim though.
[1] http://www.die-offenbachs.de/eric/index.htmlI've wrote a very detailed blog on how to use vim and python together. This includes code completion, debugging, and context sensitive help.
You can get it here: http://blog.sontek.net/2008/05/11/python-with-a-modular-ide-vim/
Outside of vim, there are other IDE's you can use:
All 3 of those are cross platform and provide debugging and code completion.
Here is a full wiki on IDE's and Python: http://wiki.python.org/moin/IntegratedDevelopmentEnvironments
Editra [1] has auto-complete for Python (incidentally it's written in wxPython). It is a nice little multi-platform editor with IDE features:
Additionally, the PyStudio plugin offers an integrated debugger and more.
[1] http://editra.org/For my Python scripting I use emacs + ropemacs [1] (which requires Pymacs [2]) + auto-complete.el [3] + yasnippet [4] along with icicles [5] for minibuffer completion. auto-complete has a bug with ropemacs that stops you from opening a project when using "." for autocompletion, but hopefully this will be fixed soon. In the meantime you can use M-x rope-open-project (which is C-x p o).
[1] http://rope.sourceforge.net/ropemacs.htmlUlipad is pretty good.
The pay version of Komodo IDE [1] has the best autocomplete of any of the IDEs I have personally tried. PyDev's autocomplete is ok, but really don't care of Eclipse unless I am working with Java/J2EE.
[1] http://www.activestate.com/Products/komodo_ide/index.mhtmlThe free Komodo IDE definitely does parse your own modules/source and include that in the code completion. It is not limited to built in Python APIs.
TextMate [1] is the best all around editor for any kind of language for the OSX. It doesn't provide intellisense type autocomplete, but does something I find more useful. Type a partial word and hit ESC. It will select the word nearest to where you are typing that matches your start string and input it. Hit ESC again to scroll through more options. There is a Windows clone called e [2].
[1] http://macromates.com@Sebastjan I started using Aquamacs on my Mac for text editing, but I felt like it lost some of the "emacs style". Now I'm using CarbonEmacs, which is older but it looks more like the original :)
TextMate [1] is an excellent editor that has a bundle [2] (it's version of plugins) for python development which can be found here [3] in their svn repository. A tutorial on how to add these plugins can be found here [4].
On a side note there are a couple of really nice Django plugins for TextMate as well.
[1] http://macromates.com/I recommend IPython as well. Besides the availability of tab-completion, IPython also supports custom "magic" keywords. My favorite is "%prun" which automatically profiles any method passed. Another benefit is pylab support. Much of my job surrounds the ability to plot data. Starting IPython with pylab turns the interpreter into the Python version of MatLab.
There is a plugin available at linil [1] for python code completion using Gedit.
Enjoy it.
[1] http://linil.wordpress.com/2008/05/31/using-gedit-to-auto-complete-python-code/GEdit should do it for youand it makes the plugin creation process very easy and understandable.
There is a plugin for python code completion in GEdit available at:
http://linil.wordpress.com/2008/05/31/using-gedit-to-auto-complete-python-code/
+1 for Wing Professional IDE.
The "Go To Definition" and "Source Assistant" can really go a long way to assist in your better python learning.
It has Vi and Emacs Emulation too, if U need either of them. Only the UI is bad, if on Windows (as it is based on GTK), It rocks on ubuntu.
If you are using any text editor, (Scite is my choice) then U'd do well by using ipyton console. (U can do a easy_install of ipython, if easy_install is installed)
With python itself providing debug options, and ipython and bash shell offering good auto-complete options, it is not really a that bad option to do away with any IDE. But if you still want an IDE (as I want), Wing Professional is the best one out there.
I have also tried SPE, PyDev and am not impressed enough to consider them; but indeed some features of PyDev like verifying whether a variable is used or not and auto-setting of different modes- Debug, PyDev, Java Browsing when U run and application is available in PyDev alone.
If U only need a good Syntax highlighting SciTE (on windows, SciTE based Notepad++) is a good option. If U need "project" option and auto-complete with Syntax highlighting, Komodo Edit is the best option. It also supports many other languages. If you want everything but the space shuttle (minus some special features of PyDev), Wing Professional is the best IDE currently available.
Most important thing is "Choose one and go with it"
YES
Komodo Edit (Win, Linux, Solaris, OSX)
PythonWin (Win)
SPE (Stani's Python Editor)
Wingware's Wing IDE
Link to NetBeans [1] support. It is early access, but NetBeans has a good track record on their beta software.
[1] http://wiki.netbeans.org/PythonFor Vim, Pydiction seems to be the only way to go. It can Tab-complete any python module (both system and 3rd party) as well as python keywrods, plus you don't need to have vim support compiled into Vim to use it. http://www.vim.org/scripts/script.php?script_id=850
OS X and no one have suggested XCode? XCode is fantastic on the Mac, got used to it when I started with Objective-C. It's a great tool, works great with Python and especially if you're writing Mac OS X software in Cocoa - where PyObjC provides the bindings. This would be my first choice when working in OS X.
To be really worthwhile the autocomple should read from your source, not just an API listing. It sounds like both Komodo and the Eclipse plugin do not support that. Is there any option that does?
The free Komodo editor performs its autocompletion on your source, not an API listing. It's what I use for GAE development, the only Python I do.