Skip to content

Instantly share code, notes, and snippets.

@sakurai-youhei
Created October 26, 2018 22:55
Show Gist options
  • Save sakurai-youhei/0d8e444b0b2986e98c0f625f68193e08 to your computer and use it in GitHub Desktop.
Save sakurai-youhei/0d8e444b0b2986e98c0f625f68193e08 to your computer and use it in GitHub Desktop.
Render HTML on the fly with QWebEngineView
from sys import argv
from sys import exit
from pygal import Bar
from PyQt5.QtWebEngineWidgets import QWebEngineView
from PyQt5.QtWidgets import QApplication
app = QApplication(argv)
view = QWebEngineView()
view.setHtml(Bar()(1, 3, 3, 7)(1, 6, 6, 4).render(True))
view.show()
exit(app.exec_())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment