Skip to content

Instantly share code, notes, and snippets.

@acrymble
Created July 5, 2011 19:44
Show Gist options
  • Select an option

  • Save acrymble/1065708 to your computer and use it in GitHub Desktop.

Select an option

Save acrymble/1065708 to your computer and use it in GitHub Desktop.
Python Write HTML 2 mac
# write-html-2.py
import webbrowser
f = open('helloworld.html','w')
message = """<html>
<head></head>
<body><p>Hello World!</p></body>
</html>"""
f.write(message)
f.close()
#Change path to reflect file location
filename = 'file:///Users/username/Desktop/programming-historian/' + 'helloworld.html'
webbrowser.open_new_tab(filename)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment