how to decode variable names in the HTML code of python
<p>i am getting the following compilation error in the below code ,place where the error is happening is the code where the variable names are being decoded?how to decode the variable names in HTML code?</p>

<pre><code> File "test.py", line 33
    """)(% hostname,change,pwd,changeref,changeref)
         ^
SyntaxError: invalid syntax
</code></pre>

<p>Following is the Code:-</p>

<pre><code>from email.mime.text import MIMEText
from subprocess import Popen, PIPE
import socket
import os

def email (body,subject):
    msg = MIMEText("%s" % body)
    msg["Content-Type"] = "text/html"
    msg["From"] = "test@company.com"
    msg["To"] = "test@company.com"
    msg["Subject"] = '%s' % subject
    p = Popen(["/usr/sbin/sendmail", "-t"], stdin=PIPE)
    p.communicate(msg.as_string())
def main ():
    change="2009"
    pwd=os.getcwd()
    changeref="refs/changes/59/206059/2"
    subject=change + "Test subject"
    hostname=socket.gethostname()
    body = ("""\
        &lt;html&gt;
         &lt;head&gt;&lt;/head&gt;
         &lt;body&gt;
          &lt;p&gt;%s&lt;br&gt;
            change - https://company/#/c/%s \n.&lt;br&gt;
            change Directory - %s for details \n.&lt;br&gt;
            Instructions: cd to the change Directory on hostname and execute the following commands \n.&lt;br&gt;
            git checkout %s&lt;br&gt;
            git fetch ssh://username@company:29418/platform/vendor/company-proprietary/code %s &amp;&amp; git cherry-pick FETCH_HEAD".
         &lt;/p&gt;
         &lt;/body&gt;
        &lt;/html&gt;
""")(% hostname,change,pwd,changeref,changeref)
    email(body,subject)

if __name__ == '__main__':
    main()
</code></pre>
