Python and Intellisense
Question:
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.
Answers:
Wingware for example implements auto-completion, see http://wingware.com/doc/edit/auto-completion .
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/
This blog entry explains setting Vim up as a Python IDE, he covers Intellisense-like functionality:
(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.
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.
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.
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.
The IDLE editor that comes with Python has an intellisense feature that auto-discovers imported modules, functions, classes and attributes.
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
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.
Pyscripter has the best intellisense i have meet 🙂
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.
IronPython is the way to go. Visual Studio has the best intellisense support and you can utilize that using IronPython
PyCharm is the best Python IDE with IntelliSense support.
For emacs and VI there’s also https://github.com/tkf/emacs-jedi.
I would recommend jedi-vim, it’s perfect to me, try it and you won’t regret.
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
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.
Wingware for example implements auto-completion, see http://wingware.com/doc/edit/auto-completion .
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/
This blog entry explains setting Vim up as a Python IDE, he covers Intellisense-like functionality:
(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.
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.
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.
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.
The IDLE editor that comes with Python has an intellisense feature that auto-discovers imported modules, functions, classes and attributes.
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
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.
Pyscripter has the best intellisense i have meet 🙂
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.
IronPython is the way to go. Visual Studio has the best intellisense support and you can utilize that using IronPython
PyCharm is the best Python IDE with IntelliSense support.
For emacs and VI there’s also https://github.com/tkf/emacs-jedi.
I would recommend jedi-vim, it’s perfect to me, try it and you won’t regret.
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