13

I want to develop a GUI in Python for ArcGIS geoprocessing.

Can I use PyQT for GUI programming in ArcGIS?

I have also considered using Tkinter and wxPython.

21

I would question the need to use your own GUI for Geoprocessing.

The idea of a geoprocessing tool is that it goes through the standard interfaces (the GP progress dialog if enabled for messages and a progress dialog, the GP tool dialog for setting parameters and running the tool, etc) and I'd like to hear the use case for trying to circumvent that all.

All in all: it's all a matter of what works best for you.

  1. Tkinter is built-in but kind of ugly and hard to get anything sophisticated up and running, but if you do write a UI in it, it'll run pretty much anywhere.
  2. Wx and PyQT are both close to functionally equivalent, though the wxPython examples are great to learn from and QT's developer tools are a little bit nicer. Look at the APIs of both and determine which one looks nicer for you to use.

I failed to mention that PyQT seems to work in a slightly more stable fashion in ArcMap and other programs with their own event loops than Wx or Tk. Wx and Tk programs tend to expect to be the only ui threads running in a process and misbehave with the event loops in other GUI programs.

8

I'm with Jason - You should really consider the necessity of a geoprocessing GUI, as the ArcGIS geoprocessing progress dialog (at least in 9.3.1, don't know about 10) can be customized a bit to adjust to your needs (adding messages, logfiles, progressor bars and such).

From my experience, Tkinter is easy to understand but complicated when wanting very out-of-the-box designs. Also, there are times it didn't interact very well with ArcGIS (windows disappearing and such). There is a "simplified" GUI library called EASYGUI which is based on Tkinter, and is much nicer and easier to control. I played with it a bit and found it to be a lot friendlier than Tkinter.

4

I've tried what you want to do, and Jason's right--use the built in tools. If you try and run just about any set of python gui widgets inside the Arcmap process, you will run into trouble of various kinds--I've tried it. Best to run your GUI outside process, and talk back to Arcmap through COM Arcobjects, using IGeoprocessor to run tools. But if your object is simply running geoprocessing tools and scripts, you really can't do much better than building your own toolbox tools and using the standard tool interfaces.

2

You could just build the GUI in .NET or Mono and then run the Python script through the Process object.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.