Python

No description

fork
loading
Files
  • main.py
  • helloworld.html
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# write-html-2-mac.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)