Python String Symbols

741
2
Jump to solution
08-05-2013 05:59 AM
deleted-user-MS0lE1F_0-sy
Occasional Contributor
In ArcGIS 10.1 - python 2.7 this use to work:

arcpy.CalculateField_management(CenterPoint,LongDMS,"!DMSLon![1:3] + \"º\" + !DMSLon![4:6] + \"'\" + !DMSLon![7:9] + \"'' \" + !DMSLon![15]","PYTHON")

However it fails in ArcGIS 10.2 - python 2.7

I have narrowed down the problem to the degree symbol.  I got the symbol in Python by holding down ALT and entering in 167.  Any ideas why this now fails when I run my toolbox script with this and how to fix it?  Or any suggestions for a work around?

Your help is much appreciated.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable
I found this on stack exchange:

>>> deg = u"\u00b0" >>> print deg  °


Looks like if you use unicoding and type: u'\u00b0' it should give you a degree symbol.

View solution in original post

0 Kudos
2 Replies
by Anonymous User
Not applicable
I found this on stack exchange:

>>> deg = u"\u00b0" >>> print deg  °


Looks like if you use unicoding and type: u'\u00b0' it should give you a degree symbol.
0 Kudos
deleted-user-MS0lE1F_0-sy
Occasional Contributor
I found this on stack exchange:

>>> deg = u"\u00b0"
>>> print deg

°


Looks like if you use unicoding and type: u'\u00b0' it should give you a degree symbol.


That worked.  Thank you very much!
0 Kudos