How do I open a local HTML file into a browser from a python file?
This is what I have so far. But I have read online that it will not work for local files? Is there a way around this?
My goal is to open the python file in the cli
then type the password
then if the password is correct
open the HTML file.
This is what I have so far but it won't open a local file:
import urllib.request
passer = "abcdef"
passwd_attempt = input("Type in the password please: ")
if passwd_attempt == passer:
page = urllib.request.urlopen('test.html')
text = page.read().decode("utf8")
print(text)
else:
print("Wrong password. Please try again.")