fp = open('D:\\UserManagement\\invitationTemplate.html', 'rb')
html = Template(fp.read())
fp.close()
result = html.safe_substitute(toFirstName='jibin', fromFirstName='Vishnu')
print(result)
python how to convert from string.template object to string