Generate HTML files directly in Python