I am building an app in Python using PyQt5 and I am going to freeze it. Therefor I would like to have my python code independent from any local file path. At some point I am loading an html code with:
self.pageXXX.html_code.load(QtCore.QUrl.fromLocalFile(QtCore.QDir.current().filePath("example.html")))
How can I change this command so that I can paste the HTML code directly in the html.load()?
Something like:
self.pageXXX.html_code.load('''
HTML code
''')
setHtml()instead ofload()qwebchannel.js, when I use setHtml() the HTML page doesn't load correctly and I get an error message:js: Uncaught ReferenceError: QWebChannel is not defined