I'm running an mysql query in the command line using subprocess.Popen
process = subprocess.Popen(conarray, shell=False, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) r = process.stdout.readlines() stdout = [x.decode('utf8').rstrip() for x in r] later I write the output in a file
f = open(file_name, 'w+', encoding='utf8') f.write(templates[idx]) It works fine but for some reason all newlines(\n) and tabs(\t) are escaped.
\t<div id="container">\n\t\t<a name="top" Any idea on how I can fix that ?
print(templates[idx])?[mysql, '--default-character-set=utf8', '-u', user, '-h', host, dbname, "-e %s" % query]templates?ńńńńń