HowTo:  Insert a quotation mark into a label expression using Python

相关信息
Article ID: 44591
Software:
ArcGIS for Desktop Advanced 10.3.1
ArcGIS for Desktop Basic 10.3.1
ArcGIS for Desktop Standard 10.3.1
Platforms:
Windows Windows 7, Windows 8, Server 2012, Server 2008 R2, Windows 8.1, Server 2012 R2

问题描述
The label expression dialog in ArcMap does not respect the exact standards of Python syntax. When trying to insert a quotation mark (") using an escape character, (for example "\""), an invalid expression error is returned. To get around this limitation and insert a quotation mark into a label, perform the following procedure.
已邀请:

EsriSupport

赞同来自:

解决方案
Use the Unicode character '\x22' in place of the quotation mark, as shown in the following two examples: Simple label expression:
[Label] + '\x22'


Advanced label expression:
def FindLabel ( [Label] ):
return [Label] + '\x22'



其它相关参考
  1. Building label expressions


创建及修改时间
Created: 4/28/2015 Last Modified: 4/29/2015
原文链接
http://support.esri.com/en/kno ... 44591

要回复问题请先登录注册