我的Python代码中出现语法错误,但我看不到哪里?

时间:2018-07-02 09:54:36

标签: python arcpy arcmap

错误出现在代码的最后一行,错误内容为SyntaxError: invalid syntax

# Step 10 - DISSOLVE RDiffIntersect using FID_RDiffBuffer and FID_"AreaFileName"

arcpy.Dissolve_management(in_features="RDiff_AreaIntersect",
out_feature_class="C:/Users/User/Desktop/claudio.gdb/RDiff_AreaIntersect_Dissolve",
dissolve_field="FID_RDiffBuffer",
ORIG_FID, statistics_fields="OBJECTID_1 FIRST;FID_RDiffBuffer FIRST;gps_latitu FIRST;gps_longit FIRST",
ORIG_FID FIRST, multi_part="MULTI_PART", unsplit_lines="DISSOLVE_LINES")

1 个答案:

答案 0 :(得分:0)

关键字参数后面有位置参数:

ORIG_FIDORIG_FID

您在ORIG_FIDFIRST之间还有一个空格

以下内容不会引发SyntaxError,但可能不准确:

arcpy.Dissolve_management(in_features="RDiff_AreaIntersect",
                          out_feature_class="C:/Users/User/Desktop/claudio.gdb/RDiff_AreaIntersect_Dissolve",
                          dissolve_field="FID_RDiffBuffer",
                          ORIG_FID = 0,  # change this value to the one you need
                          statistics_fields="OBJECTID_1 FIRST;FID_RDiffBuffer FIRST;gps_latitu FIRST;gps_longit FIRST",
                          ORIG_FID=0,  # change this value to the one you need
                          FIRST = 0,  # change this value to the one you need
                          multi_part="MULTI_PART",
                          unsplit_lines="DISSOLVE_LINES")