template = """1st header line
second header line
There are {npeople:5.2f} people in {nrooms} rooms
and the {ratio} is {large}
"""
context = {'npeople': npeople, 'nrooms': nrooms, 'ratio': ratio, 'large': large
    }
How to easily write a multi-line file with variables (python 2.6)?