Re: calculate field in ARCGIS

2009-04-10 Thread Duncan Booth
MRAB 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 backslas

Re: [?? Probable Spam] Re: calculate field in ARCGIS

2009-04-09 Thread Lydia
Thanks guys! You made it work. >On Apr 9, 12:55�pm, Chris Rebert wrote: > On Thu, Apr 9, 2009 at 12:42 PM, Lydia wrote: > > Hi Python users, > > > I ran into a problem with python coding in ARCGIS. Does anybody have the > > experience in dealing with this? > > > I need to calculate NEWFIELD bas

Re: calculate field in ARCGIS

2009-04-09 Thread Jason Scheirer
On Apr 9, 12:55 pm, Chris Rebert wrote: > On Thu, Apr 9, 2009 at 12:42 PM, Lydia wrote: > > Hi Python users, > > > I ran into a problem with python coding in ARCGIS. Does anybody have the > > experience in dealing with this? > > > I need to calculate NEWFIELD based on OLDFIELD under condition: if

Re: calculate field in ARCGIS

2009-04-09 Thread MRAB
- Original Message - From: "Chris Rebert" To: "Lydia" Cc: Sent: Thursday, April 09, 2009 1:55 PM Subject: Re: calculate field in ARCGIS On Thu, Apr 9, 2009 at 12:42 PM, Lydia wrote: Hi Python users, I ran into a problem with python coding in ARCGIS. Does anybody

Re: calculate field in ARCGIS

2009-04-09 Thread Lydia
return \"B\" \\ else: return \"\" " - Original Message - From: "Chris Rebert" To: "Lydia" Cc: Sent: Thursday, April 09, 2009 1:55 PM Subject: Re: calculate field in ARCGIS On Thu, Apr 9, 2009 at 12:42 PM, Lydia wrote: Hi Python users, I ran in

Re: calculate field in ARCGIS

2009-04-09 Thread Chris Rebert
On Thu, Apr 9, 2009 at 12:42 PM, Lydia wrote: > Hi Python users, > > I ran into a problem with python coding in ARCGIS. Does anybody have the > experience in dealing with this? > > I need to calculate NEWFIELD based on OLDFIELD under condition: if  OLDFIELD > == 0 then return string "B" otherwise

calculate field in ARCGIS

2009-04-09 Thread Lydia
Hi Python users, I ran into a problem with python coding in ARCGIS. Does anybody have the experience in dealing with this? I need to calculate NEWFIELD based on OLDFIELD under condition: if OLDFIELD == 0 then return string "B" otherwise return "". codeblock = "def codefun(code): if code == 0