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; Attachment 23615
sqlSel = ""CNTYNAME" = 'ALACHUA'" (CNTYNAME is not green indicating it is part of the string value)
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; Attachment 23615
sqlSel = ""CNTYNAME" = 'ALACHUA'" (CNTYNAME is not green indicating it is part of the string value)