calculate field in ARCGIS

Duncan Booth duncan.booth at invalid.invalid
Fri Apr 10 11:03:51 CEST 2009


MRAB <google at mrabarnett.plus.com> wrote:

> You might also want to try a triple-quoted string, which makes it
> clearer:
> 
> codeblock = """def codefun(code):
>      if code == 0:
>          return "B"
>      else:
>          return ""
> """
> 

Possibly the clearest way to do something like that is to use a single 
backslash escape and then all the vertical alignment is exactly as you see 
it:

codeblock = """\
def codefun(code):
     if code == 0:
         return "B"
     else:
         return ""
"""



More information about the Python-list mailing list