Generating HTML using Python code