AnsweredAssumed Answered

Proper syntac to write string to

Question asked by Suzanne on Apr 18, 2013
Latest reply on Apr 19, 2013 by Suzanne

I am trying to write variable values to a file so that I access the values from other scripts.  I am having problems properly saving an SQL query statement to the file.

Sample of my code:

sqlSel = arcpy.GetParameterAsText(1) (e.g. sqlSel will have the value "CNTYNAME" = 'ALACHUA'

fo.write("sqlSel = \"" + sqlSel + '''\"''' + "\n") (I have tried variations of this syntax with no luck -
fo.write("sqlSel  = \"??? + sqlSel + "\???\n")

What is written to the file;  [ATTACH=CONFIG]23615[/ATTACH]
sqlSel = ""CNTYNAME" = 'ALACHUA'" (CNTYNAME is not green indicating it is part of the string value)