How to look up Python code of  toolbox

2430
2
Jump to solution
10-20-2014 10:06 PM
geojackarooecohydro
New Contributor

Hi!

I'm a new hand of ArcPy knowing little about how to interpolate point samples to the surface by Python scripting with new approaches the ArcGIS has not provided.

I want to learn how to achieve it by imitating the methods toolbox have used ,such as the process of IDW.

But the only thing I can find is a ready-made function(such as Idw (in_point_features, z_field, {cell_size}, {power}, {search_radius}, {in_barrier_polyline_features})) which can't help learn Python scripting.

So, where could I find Python scripting of existing interpolating method which can help Python learning in toolbox or ArcPy?

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
DanPatterson_Retired
MVP Emeritus

You are learning python scripting...it is called module imports and IDW is one of the arcpy.sa (arcpy's spatial analyst module)... the scripting examples have pure python and/or a mix of examples within.  Learn how to use how use that functionality otherwise go to the main python website for an extensive list of references or get a few books... check the Esri website for a few specific to python or modelbuilder or get any python book published by O'Reilly  And don't forget the code samples on this site.  look for the Python Snippets group or the Python place  In short...anything which is an arcpy function is going to be a blackbox just like the inner workings of the vast majority of pure python modules and function.

Try to explore in detail by doing the following in your command line

>>> import arcpy
>>> help(arcpy)
Help on package arcpy:
>>> dir(arcpy)
>>> import numpy as np
>>> dir(np)
>>> help(np)
Help on package numpy:

>>> #now some pure python modules
>>> import sys
>>> dir(sys)
>>> help(sys)
Help on built-in module sys:

‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

I have snippet out large sections of results...but this should keep you busy for a while Have fun...practice until you are a pythonista

View solution in original post

2 Replies
DanPatterson_Retired
MVP Emeritus

You are learning python scripting...it is called module imports and IDW is one of the arcpy.sa (arcpy's spatial analyst module)... the scripting examples have pure python and/or a mix of examples within.  Learn how to use how use that functionality otherwise go to the main python website for an extensive list of references or get a few books... check the Esri website for a few specific to python or modelbuilder or get any python book published by O'Reilly  And don't forget the code samples on this site.  look for the Python Snippets group or the Python place  In short...anything which is an arcpy function is going to be a blackbox just like the inner workings of the vast majority of pure python modules and function.

Try to explore in detail by doing the following in your command line

>>> import arcpy
>>> help(arcpy)
Help on package arcpy:
>>> dir(arcpy)
>>> import numpy as np
>>> dir(np)
>>> help(np)
Help on package numpy:

>>> #now some pure python modules
>>> import sys
>>> dir(sys)
>>> help(sys)
Help on built-in module sys:

‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

I have snippet out large sections of results...but this should keep you busy for a while Have fun...practice until you are a pythonista

geojackarooecohydro
New Contributor

Thank you for your answer ,I will keep trying.

It's really large sections of results after typing these codes into my command line...

have a nice day!

0 Kudos