After insert lower() there's nothing written in the field? What's wrong?
# Process: Feld berechnen
arcpy.CalculateField_management(FeldHinzugefuegt, "Pfad", "\"U:\\rips\\images\\tk50\\tk\" & ([BLATT_NR].lower()) & \"co\" & \"*.*\"", "VB", "")
Solved! Go to Solution.
Python is to strange for me.
VB goes through - thanks Curtis ...
Your string is pretty complicated. You have it working in VB, great. If you decide you need to make it work in Python, I suggest dinking around at the Python command prompt. Turns out I did it wrong, see my trial and error here. I fixed the string in my post above - so nice you can edit your posts here!
# what I originally posted, wrong
>>> "\'U:\\rips\\images\\tk50\\tk\'" "\'{}\\co\\*.*\'.format(!BLATT_NR!).lower()"
"'U:\\rips\\images\\tk50\\tk''{}\\co\\*.*'.format(!BLATT_NR!).lower()"
# try again
# Note the python must evaluate to a string expression
# for the CalculateField tool
>>> ("\"U:\\rips\\images\\tk50\\tk"
... "{}\\co\\*.*\".format(!BLATT_NR!).lower()")
'"U:\\rips\\images\\tk50\\tk{}\\co\\*.*".format(!BLATT_NR!).lower()'