title: python how to convert from string.template object to string
body: <p>This is very simple.I am sure I am missing something silly.</p>
  
  <pre><code>fp = open(r'D:\UserManagement\invitationTemplate.html', 'rb')        
  html = Template(fp.read())
  fp.close()
  html.safe_substitute(toFirstName='jibin',fromFirstName='Vishnu')
  print html 
  </code></pre>
  
  <p>When i run this code in intepreter directly,I get the proper output.
  But when I run it from a file.I get <code>&lt;string.Template object at 0x012D33B0&gt;</code>.How do I convert from string.Template object to string.I have tried <code>str(html)</code>.By the bye wasn't print statement supposed to do that(string conversion) ?</p>