Select to view content in your preferred language

Python Addin quwstion

2199
2
09-16-2013 02:57 PM
by Anonymous User
Not applicable
Original User: chyang0107

Hi All,

I have a problem wit the Python Addin (10.1). I have followed the link (the python addin instruction) to create a button to execute  the python code I want. I can see my addin application in the Add-in Manager in ArcMap. However, the toolbar can not be activated and the icon is missing. I have browsed the ESRI forum (python) first to look for the resource. A post mentioned the python window in ArcMap can automatically shows the error. However, the window does not point any error. My computer is 64 bit computer (       hopefully this is not the problem). I wonder if you all could give me some suggestions.


link : http://resources.arcgis.com/en/help/main/10.1/index.html#/button/014p0000001z000000/

Thanks,
Hank
0 Kudos
2 Replies
by Anonymous User
Not applicable
Original User: JSkinn3

Hi Hank,

For your onClick function, try specify 'r' before the path to your script.  Ex:

def onClick(self):
        script = r"F:\Mark\Copy.py"
        execfile(script)
0 Kudos
by Anonymous User
Not applicable
Original User: chyang0107

Hi JSkinn3,

Thank you for the information. It works!!!

Thank again,
Hank
0 Kudos