I'm trying to develop a visualization package based on CEFpython technology, so the function has to access an html file. So the structure of the package is basically:
viz_tool
--> init.py
--> main.py
--> index.html
and in the main.py file, I defined a function:
def view():
index_filepath = os.path.realpath("index.html")
print(index_filepath)
browser = cef.CreateBrowserSync(url='file://' + index_filepath,
window_title="viz tool")
....
The goal is, after installing this package, I can do:
from viz_tool import view
view()
but of course currently the "index_filepath" would be my current working directory, so it won't be able to find the "index.html" file.
How should I change the code so I could access the "index.html" file, which presumably would be in the directory where the package is installed?
Thank you very much! and please let me know if I need to clarify anything