Special character issue in python
<p>To support special character in latex we should put single slash before special character(ex: \&amp; ),But python inserts 2 slashes if i replace with single slash (\&amp;).</p>

<pre><code>input1 = "managing &amp; director #"
changed_val = input1.replace("&amp;","\&amp;").replace("#","\#")

print changed_val
output:-managing \&amp; director \#
</code></pre>

<p>If I print the variable it shows single slash but value inside variable includes 2 slashes (at end).</p>

<p>Please advise how to just add a single slash in python so that I can use this string with special character in latex </p>

<p>Or anything in replace of latix </p>
