Question: Hi, I've been having trouble getting an html file (I have it saved in a folder on my desktop along with my python file inside

Hi, I've been having trouble getting an html file (I have it saved in a folder on my desktop along with my python file inside this folder) to open on a webbrowser on mac. My code works fine on windows but for some reason (I'm not sure if it's not finding the file correctly or maybe there is something else wrong), but it just won't open on my local browser when the code is run. I current have this so any help about how to make this work on MAC work be greatly appreciated :)) By the way, the reason I'm doing it like this is so it works on either mac or windows.

path = normpath(getcwd()+ 'myhtmlfile.html') html_file = open(path, 'w') page_layout = """   

My First Heading

"""
html_file.write(page_layout) 
filename = 'file://' + path webopen(filename) html_file.close() 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!