1. Home
  2. Computing & Technology
  3. Python

How To Create A HTML Calendar In Python Dynamically

From Al Lukaszewski, for About.com

5 of 10

The HTML and CSS Preamble

Before we print the calendar, we need to print the HTML preamble and CSS layout for our calendar. Go to this page for the code to print the CSS and HTML preamble for the calendar. and copy the code into your program file. The CSS in the HTML of this file follows the template offered by Jennifer Kyrnin, About's Guide to Web Design. If you do not understand this part of the code, you may want to consult her helps for learning CSS and HTML. Finally, to customise the month name, we need the following line:

print '<h1> %s %s </h1 >' %(current_month, current_yr)

Explore Python
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Python
  4. Web Development
  5. Python and HTML - HTML Calendars in Python - the HTML and CSS Preamble

©2009 About.com, a part of The New York Times Company.

All rights reserved.