AnsweredAssumed Answered

Proper syntac to write string to config.py

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

I am trying to write variable values to a config.py file so that I access the values from other scripts.  I am having problems properly saving an SQL query statement to the config.py 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 config.py file;  [ATTACH=CONFIG]23615[/ATTACH]
sqlSel = ""CNTYNAME" = 'ALACHUA'" (CNTYNAME is not green indicating it is part of the string value)

Attachments

Outcomes