Python code completion

After using C # for a long time, I decided to switch to Python. The question that I am now facing is related to autocomplete. I guess I'm spoiled by C #, and especially from resharper, and I was expecting something similar to Python.

My choice editor is emacs, and after some research I found autocomplete.pl , yasnippet and a rope, although I don’t understand if and how they can be installed on a cygwin-based system, and this is what I use with all the relevant documentation, according to seems to be specific to Linux ...

The emacs version I'm currently using is 23.2.1, which integrates python mode, although it is useful far from any research that can offer.

My question for python users should be asking about how common is autocomplete or manual text input (using M- / where possible)?

I'm thinking of just remembering the python build functions like len, append, extend, etc., and return to edit mode before autocomplete. How does this approach differ from what other pythonistas do?

+4
source share
6 answers

I found this post

My Emacs Python environment

to be the most useful and comprehensive list of instructions and links on how to set up a decent Python development environment in Emacs, regardless of OS platform. There is still a bit of work to do on customization, but at least it covers the popular packages and components that are typically recommended for Python in Emacs, which provide auto-complete features.

I freely used this post as a guide to configure on my Windows machine with Emacs 23.2.1 and Python 2.6.5. Although, in some cases, I also have Cygwin, instead of running the * nix shell commands mentioned in the post, I just download the packages via a web browser, unzip them using 7zip and copy them to my Emacs plugin directory.

Also, to install Pymacs, Rope, and Ropemacs, I used the Python EasyInstall package manager . To use it, I downloaded and installed the setuptools package using the installation version of Windows . After installing the cd command prompt at the appropriate download location and run the command

easy_install .

instead of shell commands shown in the message.

Typically, I saved any *.el files in my ~\.emacs.d\plugins (e.g. in %USERPROFILE%\Application Data\.emacs.d\ ) and then updated my .emacs file to reference them as documented in the message.

Despite this, sometimes I used DreamPie , since it has generally better autocomplete out of the box than my Emacs setup.

+4
source

I'm spoiled by Intellisense too. PyDev extensions for Eclipse offer a pretty good autocomplete replacement.

+4
source

I find that PyDev + Eclipse can satisfy most of my needs. There is also PyCharm from the Intellij team. PyCharm has the added benefit of seamless integration with git.

+1
source

I used PyScripter , an IDE for Windows, for a while and found this very well. It has auto-completion among many other features. This is written in Delphi - not that there is anything wrong with this - it bothers me a little, though ...

0
source

Check out Spyderlib , support most of the features, including code completion

0
source

IMO, by far the easiest way to take advantage of the python tools available for emacs, is to use the default settings that are all configured: https://github.com/gabrielelanaro/emacs-for-python

I really took the time to get pymacs and ropemacs and python-mode, all work independently before finding this little stone, and now I fully rely on it for all my python-based settings. If you are a beginner, I would definitely start there.

0
source

All Articles