I need to open a HTML page in the web browser using Python.
I am doing this with the webbrowser
lib and webbrowser.open(url, new = 2)
and actually it works pretty fine. But because I want to open the page from a file and I also want to export my project to other computers the URL is not always the same, according to where the user stored my project.
At the moment I am using this
url = r"file:///C:/Users/xyx/Desktop/Application/Main/TestApp/index-release.html"
But I need to do something like this:
url = r"file:///../Javascript/Main/TestApp/index-release.html"
With the dots for going a directory back(in what ever dir my application is stored and then into the afterwards given path. But if I do it like this, it does not work and just opens a "about:blank" page. Thanks for your help.