HTML Wrapper in Python

The HTML wrapper module can be called in another program to display its output within HTML/CSS. Or it could be modified to pull in a master HTML template (such as index.html), concatenate new body content, and create a new HTML file, which could simply be uploaded to the server.

import webbrowser

def oberlinfo(x):
    #Places whatever object x is into's HTML design,
    #writes the entire HTML file,
    #and automatically opens it.

    str = "<!DOCTYPE html><html><head><title></title><meta name=\"description\" content=\" Content creation by John Oberlin.\"><!--pyI head--><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /><meta name=\"viewport\" content=\"width=device-width,initial-scale=1\"><link rel=\"shortcut icon\" href=\"\"><link href=\"|Ubuntu:700\" rel=\"stylesheet\"><link rel=\"stylesheet\" href=\"\" type=\"text/css\"><!--pyO--></head><body><div class=\"main\"><!--pyI menu--><div onclick=\"myFunction()\" class=\"dropdown\"><div class=\"dropdown logo\"></div><div id=\"myDropdown\" class=\"dropdown-content\"><a href=\"\">John Oberlin</a><a href=\'\'>Freelance Writer and Editor</a><a href=\'\'>SEO Strategies</a><a href=\"\"> Coding</a><a href=\'\'>Twitter</a><a href=\'\' target=\"_blank\">Portal</a></div></div><!--pyO-->"

    str += "<h1>Py HTML Wrapper</h1>" + x

    str += "<!--pyI script--><script>/* When the user clicks on the button, toggle between hiding and showing the dropdown content */  function myFunction() {document.getElementById(\"myDropdown\").classList.toggle(\"show\"); } // Close the dropdown menu if the user clicks outside of it  window.onclick = function(event) {    if (!\'.dropdown\')) {var dropdowns = document.getElementsByClassName(\"dropdown-content\"); var i; for (i = 0; i < dropdowns.length; i++){var openDropdown = dropdowns[i]; if (openDropdown.classList.contains(\'show\')) {openDropdown.classList.remove(\'show\');}}}}</script><!--pyO--></body></html>"

    with open("oberlinfo-generator.html","w") as f:

    url = "oberlinfo-generator.html"