Python - 删除双引号“以便脚本运行

问题描述:

我正在使用Python脚本来编辑许多形状文件的表。以下脚本运行正常,但如果在SIT_FULL_S字段中有任何”标记,脚本错误和关闭。Python - 删除双引号“以便脚本运行

gp.CalculateField_management(fc + "\\Parcels.shp","SIT_FULL_S", "!SIT_FULL_S!.lstrip('0')", "PYTHON") 
arcgisscripting.ExecuteError: ERROR 000539: Error running expression: "9030 W SR 2 HWY "A"".lstrip('0') <type 'exceptions.SyntaxError'>: invalid syntax (<string>, line 1) 
Failed to execute (CalculateField). 

我有两个选择,创建贯穿而删除的所有出现一个新的脚本“然后运行上面的脚本或修改上面的脚本忽略”,并继续合运行。

任何人都可以帮忙吗?

退出:

"string \"inner string\"" 

或不混合语录:

'string "inner string"' 
+3

或三引号,:` “” “ '字符串', ”其他字符串“,等等。”” “` – Seth 2011-01-13 00:55:58