I'm trying to change from a.net toolbar to a Python toolbar in ArcGIS 10.2 and am having some difficulty. I have some stand alone python script which I know works and does what I need to do but I can't work out how to get the add in button to call this script or how to incorporate the script in with the button add in script.
import arcpy import pythonaddins class ImportCSVFile(object): """Implementation for Import_CSV.button (Button)""" def __init__(self): self.enabled = True self.checked = False def onClick(self): script1 = "C:\Users\xxx\Documents\AddIns\pythonAddin\Install\xxx" execfile(script1)
I've also tried using
os.startfile(xxxxx) instead of
script1 = "xxxx" and
I don't get an error but the button doesn't do anything. Does anyone have any ideas of how to get this to work?