Exemple #1
0
# liquor_types.html

fp = open('html/liquor_types.html', 'w')
print >>fp, header % 'Liquor Types'
print >>fp, navbar
print >>fp, """
<h2>Liquor Types</h2>
<table>
  <tr>
    <th>Manufacturer</th>
    <th>Liquor</th>
    <th>Type</th>
  </tr>
"""

for manufacturer, liquor, typ in db.get_bottle_types():
    print >>fp, """  <tr>
    <td>%s</td>
    <td>%s</td>
    <td>%s</td>
  </tr>
""" % (manufacturer, liquor, typ)

print >>fp, "</table>"
print >>fp, footer
fp.close()

# inventory.html

fp = open('html/inventory.html', 'w')
Exemple #2
0
<a href='recipes.html'>Recipes</a></br>
<a href='liquor_types.html'>Liquor Types</a></br>

"""


fp.close()

###

fp = open('html/liquor_types.html', 'w')

print >>fp,"""
<table border=\"1\" cellpadding =\"5\">
<tr><th>Manfacturer</th><th>Liquor</th><th>Type</th></tr>
"""
for item in db.get_bottle_types():
    print >>fp,"<tr><td> %s </td><td> %s </td><td> %s </td></tr>" % item

print >>fp,"""
</table>
"""
print >>fp, """
</br>
<a href='index.html'>Home</a></br>
<a href='recipes.html'>Recipes</a></br>
<a href='inventory.html'>Inventory</a></br>

"""
fp.close()