my code is ok when reading "plotly-latest.min.js" from online and I have save it into ".js" and put in same directory with my ".py" file. But I am fail to read from local without internet.
import sys
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWebEngineWidgets import QWebEngineView
from PyQt5.QtCore import QDir, QUrl
import plotly
import plotly.graph_objs as go
sys.argv.append("--disable-web-security")
#sys.argv()
app = QApplication(sys.argv)
x1 = [10, 3, 4, 5, 20, 4, 3]
trace1 = go.Box(x = x1)
layout = go.Layout(showlegend = True)
data = [trace1]
fig = go.Figure(data=data, layout = layout)
raw_html = '<html><head><meta charset="utf-8" />'
raw_html += '<script src="https://cdn.plot.ly/plotly-latest.min.js"></script></head>' #ok
#raw_html += '<script type="text/javascript" src="file://C:/Users/User/Desktop/Python-setup test/plotly-latest.min.js"></script></head>'
raw_html += '<body>'
raw_html += plotly.offline.plot(fig, include_plotlyjs=False, output_type='div')
raw_html += '</body></html>'
view = QWebEngineView()
view.setHtml(raw_html)
view.show()
sys.exit(app.exec_())
now I am try to make the code below read from local
raw_html += '<script src="https://cdn.plot.ly/plotly-latest.min.js"></script></head>'
code below not working and no errors
raw_html += '<script type="text/javascript" src="file://C:/Users/User/Desktop/Python-setup test/plotly-latest.min.js"></script></head>'