72

Is there an equivalent to 'intellisense' for Python?

Perhaps i shouldn't admit it but I find having intellisense really speeds up the 'discovery phase' of learning a new language. For instance switching from VB.net to C# was a breeze due to snippets and intellisense helping me along.

9

16 Answers 16

31

This blog entry explains setting Vim up as a Python IDE, he covers Intellisense-like functionality:

Python Intellsense
(source: dispatched.ch)

This is standard in Vim 7. There are a number of other very useful plugins for python development in Vim, such as Pyflakes which checks code on the fly and Python_fn.vim which provides functionality for manipulating python indentation & code blocks.

5
  • 1
    Is there something like this for Emacs?
    – J S
    Commented Nov 26, 2009 at 10:55
  • 1
    I'm afraid I don't use emacs! I came across this blog entry but I can't make any comment about its quality : hide1713.wordpress.com/2009/01/30/…
    – redacted
    Commented Nov 27, 2009 at 17:11
  • I use these settings jesshamrick.com/2012/09/18/emacs-as-a-python-ide
    – Chirag
    Commented Dec 18, 2012 at 4:08
  • 1
    The link has expired! could you please update it Commented Jul 21, 2021 at 12:19
  • Sadly, this answer is no longer useful as it references a blog post that is no longer available.
    – user153923
    Commented Aug 29, 2021 at 18:16
24

Have a look at python tools for visual studio, they provide code completion (a.k.a intellisense), debugging etc ...

Below is a screenshot of the interactive shell for python showing code completion.

enter image description here

1
  • 2
    Do keep in mind intellisense is NOT just code-completion, it's a generalized term that also applies to the tooltips when you hover your mouse over a function or variable, aka code-insight, which can be seen to the right of the highlighted compile method. this is something almost all Python IDEs don't do properly if at all, Eclipse only comes close, however it doesn't show you the types a variable can hold, or a function can take/return. (RE_Pattern in your screenshot)
    – Tcll
    Commented Aug 31, 2015 at 19:08
18

The PyDev environment for Eclipse has intellisense-like functionality for Python. Keeping an interactive console open, along with the help(item) function is very helpful.

1
  • And unlike other Python "IDEs" I tried, it even gets C extensions (at least PyQt4) right.
    – user395760
    Commented Aug 23, 2010 at 19:01
14

The dynamic nature of the language tends to make autocomplete type analysis difficult, so the quality of the various completion facilities menitoned above varies wildly.

While it's not exactly what you asked for, the ipython shell is very good for exploratory work. When I'm working with a new module, I tend to pull it into ipython and poke at it. Having tried most of the solutions mentioned above (though it's been years since Wing), ipython's completion facilities are consistently more reliable. The two main tools for exploration are tab complete and appending a question mark to the module/function name to get the help text, e.g.:

In [1]: import sqlalchemy

In [2]: sqlalchemy.s #tab completion
sqlalchemy.schema    sqlalchemy.select    sqlalchemy.sql       sqlalchemy.subquery

In [2]: sqlalchemy.select? #Shows docstring

In [3]: sqlalchemy.select?? #Shows method source

In [4]: edit sqlalchemy.select #opens the source in an editor
9

The IDLE editor that comes with Python has an intellisense feature that auto-discovers imported modules, functions, classes and attributes.

1
  • or you can just use dir(object) to get that very same attributes list. but it's far from the informative intellisense I'm used to.
    – Tcll
    Commented Aug 31, 2015 at 19:22
8

I strongly recommend PyDev. In Pydev you can put the module you are using in the Forced Buildins, mostly the code-completion will work better than in other IDEs like KOMODO EDIT.

Also I think IPython is very helpful. Since it is 'run-time' in IPython, the code-completion in IPython won't miss anything.

4
  • 1
    I wouldn't advise using PyDev. I've tried it with Django a bit and had lots of unresolved dependencies when it came to plugins like Akismet or Markdown. I tried many solutions but it didn't work in the end. I've heard much good about PyCharm, but haven't tried personally.
    – Wojtek
    Commented Sep 9, 2013 at 14:37
  • @Wojtek, have you another IDE to recommend ? I've tried PyDev, Sublime and Komodo Edit and Komodo is very nice because it's lightweight compared to Eclipse but I've some trouble setuping or understanding the way it's intellisense work...
    – RPDeshaies
    Commented Nov 20, 2013 at 16:49
  • 1
    @Tareck117 No, I'm not really a pythonist, I just make a quick foray into it once in a while. I use Sublime, but only for one-file scripts, it's not an IDE per se. As I said, I can recommend PyCharm, some of my pythonist friends use it and like it. I've heard it went free recently (community edition) with some limited features, but fully-working intellisense. You should give it a try. It's a commercial product so I presume they make it work properly, but can't guarantee.
    – Wojtek
    Commented Nov 20, 2013 at 17:06
  • VS2010 (can't use higher) with Python Tools is the best I've used with it's intellisense, Eclipse/PyDev does not provide as much information.
    – Tcll
    Commented Aug 31, 2015 at 19:19
7

PyCharm is the best Python IDE with IntelliSense support.

1
  • Worth mentioning that it does not support IntelliSense for dynamic modules Commented Sep 5, 2018 at 10:34
6

I'd recommend Komodo Edit. However, I should point something out: you're not going to get anything quite as good as what you're used to with Visual Studio's C# intellisense. Python's dynamic nature can make it difficult to do these kinds of features.

5

Wingware for example implements auto-completion, see http://wingware.com/doc/edit/auto-completion .

4

ctags + vim works ok, too, although it is not as powerful as intellisense. Using this with ipython, you can get online help, automatic name completion, etc... But that's obviously command-line oriented.

Eclipse + pydev can do it as well, but I have no experience with it: http://pydev.sourceforge.net/

4

Well, I think the most dynamic way to learn Python is to use iPython.

You got autocompletion when using tab, dynamic behaviour because it's a shell and you can get the full documentation of any object / method typing :

object.method ?

When developping, I agree that PyDev is cool. But it's heavy, so while learning, a text editor + iPython is really nice.

2

Pyscripter has the best intellisense i have meet :)

3
  • 1
    there's no intellisense in pyscripter. It only has basic auto-completion.
    – dns
    Commented Jun 6, 2013 at 16:39
  • 1
    You really need to use Visual Studio mate, PyScripter was one of the worst high-end IDEs I've used.
    – Tcll
    Commented Aug 31, 2015 at 19:31
  • 3
    At this point of time i would suggest Pycharm. It has gotten really good.
    – hugo24
    Commented Sep 1, 2015 at 6:00
2

For emacs and VI there's also https://github.com/tkf/emacs-jedi.

2

I would recommend jedi-vim, it's perfect to me, try it and you won't regret.

0

IronPython is the way to go. Visual Studio has the best intellisense support and you can utilize that using IronPython

1
  • I'd recommend just sticking with normal python, .NET is very bad... but agreed VS has the best intellisense.
    – Tcll
    Commented Aug 31, 2015 at 19:34
0

Try visual Studio Code. It has very powerful Python and Django support and thousands of plugins for other languages used in a Python project such as CSS, HTML and Django templates.

Best of all, it is free: https://code.visualstudio.com

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.