4

After using C# for long time I finally decided to switch to Python. The question I am facing for the moment has to do about auto-complete. I guess I am spoiled by C# and especially from resharper and I was expecting something similar to exist for Python.

My editor of choice is emacs and after doing some research I found autocomplete.pl, yasnippet and rope although it is not clear to me if and how they can be installed in a cygwin based system which is what I use since all the related documentation appears to be linux specific...

The version of emacs I currently use is 23.2.1 which bundles the python mode that although useful is far behind from whatever research has to offer.

My question to python users has to do about how common is autocomplete vs manual typing (using M-/ where possible) ?

I am thinking about just memorizing python build-in functions like len, append, extend etc. and revert close to a pre-autocomplete editing mode. How different such an approach is from what other pythonistas are doing?

BenMorel
  • 34,448
  • 50
  • 182
  • 322
JohnP
  • 677
  • 1
  • 9
  • 18
  • Which platform, text mode or GUI? Are your developments targeting some framework like django? – Paulo Scardine Oct 04 '10 at 14:52
  • The platform is cywin using both text-mode and wxPython for GUI. For the moment I don not plan using django. – JohnP Oct 04 '10 at 15:12
  • The more closely I read your question, the less sure I am what you're asking. Is this your question: What do other Python programmers do for auto-completion, and is there a common choice? – JasonFruit Oct 04 '10 at 15:14
  • There's a list of Python editors and IDEs with information about support for autocompletion here: http://stackoverflow.com/questions/81584/what-ide-to-use-for-python. – JasonFruit Oct 04 '10 at 15:16
  • Exactly.. I would like to know if the majority of python users is either relying in some auto-completion mechanism or instead using a more manual appoach – JohnP Oct 04 '10 at 15:18

6 Answers6

4

I'm spoiled by Intellisense too. The PyDev extensions for Eclipse offer a pretty good auto-complete substitute.

  • I am aware about PyDev... I would prefer staying with emacs if possible but I will try PyDev and see if it is suiting my coding habits – JohnP Oct 04 '10 at 15:16
4

I found this post

My Emacs Python environment

to be the most useful and comprehensive list of instructions and references on how to setup a decent Python development environment in Emacs regardless of OS platform. It is still a bit of work to setup but at least it covers the popular packages and components generally recommended for Python in Emacs that provide auto-completion functionality.

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

Also, to install Pymacs, Rope, and Ropemacs, I used Python's EasyInstall package manager. To use it, I downloaded and installed the setuptools package using the Windows install version. Once installed, at the command line, cd to their respective download locations and run the command

easy_install .

instead of the shell commands shown in the post.

Generally, 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 post.

Despite all this, on occasion, I've used DreamPie since it does have overall better auto-completion out of the box than my Emacs setup.

Ray
  • 187,153
  • 97
  • 222
  • 204
1

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

Manoj Govindan
  • 72,339
  • 21
  • 134
  • 141
0

IMO, by far the easiest way to take advantage of the python tools available for emacs is to take advantage of the defaults that are all set up at: https://github.com/gabrielelanaro/emacs-for-python

I actually took the time to get pymacs and ropemacs and python-mode all working independently before finding that little gem, and now I rely on it entirely for all my python based customizations. If you are new, I would definitely start there.

RussellStewart
  • 5,293
  • 3
  • 26
  • 23
0

I've been using PyScripter, an IDE for Windows, for a while now, and have found it very good. It has autocompletion among many other features. It's written in Delphi -- not that there's anything wrong with that -- it just bothers me a bit, though...

martineau
  • 119,623
  • 25
  • 170
  • 301
0

Take a look at Spyderlib, support most of the features including code completion