Tuesday, September 27, 2011

Usage() - Arcpy

Usage() is a helpful tool that will return the syntax for a specific tool.  It's a great thing to use in IDLE when writing a python script and you forget what variables go where.

Example:
>>> import arcpy
>>> print arcpy.Usage("Buffer_analysis")
Buffer_analysis(in_features, out_feature_class, buffer_distance_or_field, {FULL | LEFT | RIGHT | OUTSIDE_ONLY}, {ROUND | FLAT}, {NONE | ALL | LIST}, {dissolve_field;dissolve_field...})
Buffer Features
>>> print arcpy.Usage("MakeFeatureLayer_management")
MakeFeatureLayer_management(in_features, out_layer, {where_clause}, {workspace}, {field_info}) Create a Feature Layer

Pretty help for those who don't have to refer to the help document all the time.
Enjoy!