def get_LCP(letter): for letter in ['A','B','C','D','E','F']: return os.path.join(savepath + "\\Scratch.gdb" + "\\LCP_" + (letter))
count = 0 while count < 2: ... costPath2 =CostPath(originValue, setNull2,get_backlink(count + 1),"EACH_CELL","") costPath2.save(get_LCP(letter).next)
Solved! Go to Solution.
def get_LCP(costPath2): for letter in ['A','B','C','D','E','F']: path = os.path.join(savepath + "\\Scratch.gdb" + "\\LCP_" + letter) costPath2.save(path) count = 0 while count < 2: ..... costPath2 = CostPath(originValue, setNull2,get_backlink(count + 1),"EACH_CELL","") get_LCP(costPath2)
You may want to look at chr(). This will return the string version of the numeric value, for example, chr(97) = 'a'. You'd have to look up the value of the character in your encoding and add that to your counter. For example, in ascii, A = 65, B = 66, C = 67...a = 97, b = 98...etc. So in ascii, if your counter starts at 0, add 65 to it so that 0 will become A, 1 will become B, etc. Unicode and other encodings are probably different.