Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from string import Template
- XML_TEMPLATE = Template("""
- <xml>
- <name>$name</name>
- <place>
- <city>$city</city>
- <country>$country</country>
- </place>
- <lang code="$code" />
- </xml>
- """)
- params = {
- 'name':'John Smith',
- 'city':'Mumbai',
- 'country':'India',
- 'code':'Marathi'
- }
- print(XML_TEMPLATE.substitute(params))
Add Comment
Please, Sign In to add comment