I have this block of code that reliably creates a string object. I need to write that object to a file. I can print the contents of \'data\' but I can\'t figure out how to write
with open (template_file, "r") as a_string:
data=a_string.read().replace('{SERVER_NAME}', server_name).replace('{BRAND}', brand).replace('{CONTENT_PATH}', content_path).replace('{DAMPATH}', dampath).replace('{ENV}', env).replace('{CACHE_DOCROOT}', cache_docroot).replace('{SLD}', sld)
filename = "{NNN}_{BRAND}_farm.any".format(BRAND=brand, NNN=nnn)
with open(filename, "w") as outstream:
outstream.write(data)