Hi,
I have a tool based on y Python script which used to work perfectly in ArcGIS Desktop...
In Pro, it does not! In a CalculateField_management statement, I use the following codeblock to calculate the value to assign. In this case, it is a String and it looks like causing the problem (I have a similar statement with similar codeblock calculating integer value and it works fine).
Has the syntax for dealing with String changed slightly with Python 3 used in Pro? Something with single or double quotes? A combination of both?
Thanks
codeblock_source <SPAN class="operator token">=</SPAN> <SPAN class="string token">"""def getSource(elev,user_source,source,ons_off):
if elev != -9999 and ons_off == 'Onshore' and source == 'NA':
return user_source
elif ons_off == 'Offshore':
return 'OFF'
else:
return source"""</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>