1

I've looked at most of the IDE's out there. I've set up vim to use autocompletion and I'm using it right now. However, I can't seem to get it to work like Visual Studio with .NET. Autocompletion seems to work only in certain cases and it only shows methods and not what parameters they take. It's pretty much unusable to me.

What I'm after is a pop-up that will show me all methods available and the parameters they take. Pretty much the feel of VS2010 when you're programming .NET.

MPelletier
  • 16,256
  • 15
  • 86
  • 137
s5s
  • 11,159
  • 21
  • 74
  • 121
  • 2
    http://stackoverflow.com/questions/81584/what-ide-to-use-for-python – develerx Nov 08 '11 at 22:34
  • Yes, this one was among the first I stumbled across. However, a lot of the IDE's have autocomplete which seems to be not working. I've tried Eric4 and the autocomplete only autocompletes what's already used on the page. It's supposed to autocomplete everything but it's not. – s5s Nov 08 '11 at 22:39
  • 1
    Autocomplete is very hard to do on a language with untyped parameters. I mean, how does it know? I think you'll find that the opportunities for autocomplete in a language like Python are less than in a language in which the editor can reasonably know the type of each variable at write-time. – Larry Lustig Nov 08 '11 at 22:40
  • Don't expect full auto-completion with Python, type dictionaries are far too dynamic for that. – Cat Plus Plus Nov 08 '11 at 22:44
  • I see. I thought I could get something like C#. – s5s Nov 08 '11 at 22:56

3 Answers3

6

You won't get the kind of autocompletion in a dynamic language like Python that you get in more explicitly typed languages. Consider:

 def MyFunction(MyArg):
      MyArg.

When you type the "." in MyArg., you expect the editor to provide a list of methods with arguments. That can't happen in Python because the editor has absolutely no way of knowing what type (or types) MyArg could possibly be. Even the Python compiler doesn't have that information when it's compiling the code. That's why, if you put MyArg.SomeNonExistentFunction() you won't get any kind of error message until runtime.

If you wrote something like:

 def MyFunction:
      MyObject = MyClass(SomeArg)
      MyObject.

then a smart enough editor can supply a list of methods available after that final ".".

You'll find that those editors that are supplying autocomplete "sometimes" are doing so in cases similar to my second example, and not doing so in cases similar to the first. With Python, that's as good as you can get.

Larry Lustig
  • 49,320
  • 14
  • 110
  • 160
  • Aha I see! Well, at least I find out about Omni Complete which seems useful for C++. Anything I can use as a library reference? Currently I have to go and sift through all the documentation and find the method I'm after. I really would like to get a list of methods and arguments and nothing else - much faster. – s5s Nov 08 '11 at 22:57
  • There's complete documentation on-line for the standard library. However, most distributed Python code is written to be self-documenting. You can import the package you're interested in and use the functions `dir()` and `help()` on objects, classes, or functions to get information about what members they contain and how to use them. – Larry Lustig Nov 08 '11 at 23:02
3

Gedit has a developer plugin which tries to do some syntax completion. For reasons already mentioned, it doesn't work very well. I found it more annoying than helpful and disabled it after a few weeks trial.

ipython's new Qt console has tab completion and you can have some tooltip sort of popups with syntax help and docstrings. See screenshot below for example..

But as most people have already pointed out, this kind of thing you are asking for is really more appropriate for less dynamic languages.

enter image description here


enter image description here

wim
  • 338,267
  • 99
  • 616
  • 750
3

I've been using Eclipse with the PyDev extension for some time now. The auto-completion there is really quite impressive, I highly recommend it.

taleinat
  • 8,441
  • 1
  • 30
  • 44
  • Yes, I checked it out but when I tried to install it Eclipse said there was some error. I wonder whether it's because I'm running Galileo (which is not the newest version). – s5s Nov 08 '11 at 23:22