【问题标题】:I would like to pass raw HTML to QWebEngineView but getting errors我想将原始 HTML 传递给 QWebEngineView 但出现错误
【发布时间】:2020-10-21 17:54:13
【问题描述】:
app = QApplication(sys.argv)

abc = pd.read_csv("filepath")

web = QWebEngineView()
web.load(QUrl.fromLocalFile(abc.to_html())

web.show()

sys.exit(app.exec_())

【问题讨论】:

  • 试试web.setHtml(abc.to_html())而不是web.load(QUrl.fromLocalFile(abc.to_html())
  • 你可以在上面的代码中找到同样的东西。
  • 为什么不直接将 CSV 加载到 WebEngineView 中?
  • @suryaambati 是什么东西?

标签: python pyqt pyqt5 qtwebengine qwebengineview


【解决方案1】:

如果你要加载 html,那么你必须使用setHtml() 方法:

web.setHtml(abc.to_html())

【讨论】:

猜你喜欢
  • 2021-09-14
  • 1970-01-01
  • 2019-11-29
  • 1970-01-01
  • 2015-11-11
  • 2017-10-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多