open html file local browser python code example
Example 1: how to open local html file in python
import codecs
file = codecs.open("sample.html", "r", "utf-8")
print(file.read())
Example 2: how to make html files open in chrome using python
// Also, use the absolute path of the file:
webbrowser.open('file://' + os.path.realpath(filename))