FAQ
overflow

Great Answers to
Questions About Everything

QUESTION

I am finding ArcMap runs slower, if you have written a script, which imports arcpy.

You may wish to write a script that can be operated in ArcMap, through the python window, or as a standalone python script. If so, you'll have to import arcpy. However, if you do this and run it in the python window, it will run slower.

{ asked by Hairy }

ANSWER

I have put this code into my script and it runs much quicker:

try:
    arcpy 
except NameError:
    import arcpy

This is saving considerable time in our scripts in ArcMap now.

This may all change in SP2, but none the less...

{ answered by Hairy }
Tweet