20

I have been scripting in Python for ArcGIS 10, and so far I have just been using Notepad++.

I like how the Python command line interface code-completes arcpy functionality for you, showing you your options, and I was wondering if there is a way to add this feature to an external editor.

7 Answers 7

15

PyScripter is my choice. It's free and open source and a lightweight and quick install. There is even a registry-free installation that doesn't require admin rights for installation.

4
  • 4
    Code completion seems to work for the Arc10 arcpy module, but I was not able to enable it for Arc 9.x. For future readers, to enable arcpy (Arc10) code-completion in PyScripter, go to Tools--> Options--> IDE Options--> and add "arcpy" to the "special packages" line of Code Completion section. NOTE: code-completion is case sensitive, so arcpy.copyfeatures will not code-complete, but arcpy.CopyFeatures will code-complete (note the capital "C" and "F". Commented Sep 23, 2011 at 15:31
  • 2
    An additional note on code completion... you can disable case sensitivity by unchecking "case sensitive" in the same location as noted above. Commented Jan 19, 2012 at 17:04
  • Also, the Ctrl-Shift-Space hotkey will bring up the code completion "call tip" if you are for example in the middle of writing a function parameter list and you did something to close it.
    – blah238
    Commented Feb 17, 2013 at 19:57
  • The question is about autocompletion of ArcPy but your "answer" makes no mention of it. Please address this ASAP, because it is currently at risk of being deleted.
    – PolyGeo
    Commented Jan 25, 2017 at 8:00
9

I recommend WingWare IDE. It seems to have the best debugging and code completion out of the Python IDEs I've seen. One of the motivating factors for arcpy in 10.0 was that it would have better code completion than arcgisscripting offered.

8

MS recently released Python Tools for Visual Studio - once you follow a few steps outlined here: http://blog.guerrillagis.net/?p=878 Visual Studio will provide you with intellisense, method signatures, syntax highlighting, a REPL and a debugger.

2
  • 1
    +1! Visual Studio 2010 with PyTools is a fantastic Python IDE. It even integrates with the Visual Studio Integrated Shell for a completely free setup even without any existing Microsoft licenses.
    – Philip
    Commented Jun 3, 2011 at 16:59
  • I use Python Tools for Visual Studio too - moved here from PythonWin several years ago and have never gone back
    – Midavalo
    Commented Apr 16, 2016 at 2:34
7

I'd try Eclipse using the Pydev extensions. I know it didn't do code completion very well with the python geoprocessor in 9.3, and I haven't got 10 to play around with yet, but even without it, it is a much nicer editor with some very cool features.

1
  • 1
    Have finally got down to playing with 10 - code complete does work w. Eclipse. Good luck to anyone else trying it out!
    – om_henners
    Commented Oct 16, 2010 at 14:38
5

Code completion is a feature of the editor, this stackoverflow post has a listing of editors which support code completion. In Notepad++, you can enable autocompletion as a preference.

1
  • 1
    Thanks, that was really helpful. I have autocompletion enabled, but it is only completing core python code. Is it possible to have it autocomplete arcpy functions? Thanks for the help, I am fairly new to this.
    – Tanner
    Commented Jul 30, 2010 at 19:28
3

It seems to be poorly known that IDLE supports autocompletion reliably too.

If you are using it with ArcPy always run the import arcpy part of the script once so that your script window becomes aware of that site-package.

However, if you do not see autocompletion kick in then the trick is to use "Ctrl + Spacebar" to trigger it.

I have seen this mentioned here at Getting ArcPy autocomplete to work in IDLE? and on StackOverflow at Python IDLE. Auto-complete/Show completions not working but it is no doubt in the IDLE documentation somewhere too.

1

Active State komodo works fine for me. I just added a reference to the arcpy directory in the preferences. It has good debugging and a good interface. Autocompletion works for arcpy and my own libraries.

1
  • Hi Neil, can you better describe how? Im trying to add it on preferences as described but not having luck finding the .xml for code intelli inside arcpy folder. Commented May 13, 2013 at 22:36

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.