Magic Method Recipe: HTML Generation ==================================== Step 0 ------ .. sourcecode:: python from string import Template greeting = 'Salutations' name = 'Abdullah' imgSrc = 'http://www.google.com/intl/en_ALL/images/logo.gif' link = 'http://feihonghsu.blogspot.com' template = Template("""\

${greeting}, ${name}!

This is an image

Try clicking on the link right now.

""") html = template.substitute(**locals()) print html Expected output: .. sourcecode:: html

Salutations, Abdullah!

This is an image

Try clicking on the link right now.

Solution: `html0.py `_ `Go to next step `_