1
2
3
4
5
6
7
8
9
10
11
12
13
import webbrowser
 
message = """<html>
<head></head>
<body><p>Hello World!</p></body>
</html>"""
 
filepath = "hello.html"
with open(filepath, 'w') as f:
    f.write(message)
    f.close()
 
webbrowser.open_new_tab(filepath)