Python encode string to html
<p>How would one take a string and encode special characters to html?</p>

<p>for example, if I have "test@test" how would I encode it so it becomes "test%40test"</p>

<p>Is there an easy way of doing this instead of using replace to manually list every one I want to replace?</p>

<p>Try <code>urlencode</code>function. Documentation here.</p>

<p><a href="https://docs.python.org/2/library/urllib.html#urllib.urlencode" rel="nofollow">https://docs.python.org/2/library/urllib.html#urllib.urlencode</a></p>

python html string encode