ArcPy and Tkinter

11200
14
Jump to solution
05-22-2012 07:09 AM
OlivierVoyer
New Contributor II
Hi,

I would like to know if ArcPy currently supports executing scripts using Tkinter inside ArcMap, i.e directly from the Python Window or in the ArcToolbox (embedded)?

When I tried to display a simple "Hello World" form, ArcMap 10 crashed on me.

Regards,

Olivier
14 Replies
OlivierVoyer
New Contributor II
Thank you for your answer.

I've never heard about this "Geoprocessing script tool framework"... could you give me more details about this tool? Does it come in the base package of ArcMap?
0 Kudos
NobbirAhmed
Esri Regular Contributor
Please email me at nahmed@esri.com - let's figure it out first and then we'll post the outcome to this thread. Please let me know what data/values you'll use and how.
0 Kudos
OlivierVoyer
New Contributor II
Please email me at   nahmed@esri.com - let's figure it out first and then we'll post the outcome to this thread. Please let me know what data/values you'll use and how.


I don't mind sending you an email, but why not keep exchanging through this forum, so that everybody can benefit from our discussion? 🙂

What I need to achieve is pretty simple, yet not fully determined. I just want to pop up a simple form giving the user some control over what would be done by my script, without using script parameters. Let's say I want to give the user a choice in the middle of my algorithm, for example if I want to pop up a window with several choices dynamically populated. That would be a good example of what I'm trying to do.
0 Kudos
NobbirAhmed
Esri Regular Contributor
If you want to run your algorithm from command line and want the user to interact in the middle of the algorithm then a Python GUI program is your only option. As Esri does not officially support any such GUI yet - this forum is the only option to get help 😞

On the other hand, if the user will interact with your script through some GUI then script tool framework is a good option. The Tool Validator class mechanism will allow you to fill up options dynamically based on what selection is made in other parameters.

In case you want to explore the script tool mechanism, you can start here:
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/A_quick_tour_of_creating_script_tools/...

This topic elaborates how to dynamically update parameter choices: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Customizing_script_tool_behavior/00150...
OlivierVoyer
New Contributor II
Thank you! That answers my question perfectly.
0 Kudos