Archived

pyqt webview

An old note — I haven't updated it since I wrote it.
 1from PyQt5.QtCore import *
 2from PyQt5.QtWidgets import *
 3from PyQt5.QtGui import *
 4from PyQt5.QtWebEngineWidgets import *
 5
 6import sys
 7
 8class MainWindow(QMainWindow):
 9
10    def __init__(self, *args, **kwargs):
11        super(MainWindow,self).__init__(*args, **kwargs)
12
13        self.browser = QWebEngineView()
14        self.browser.setUrl(QUrl("https://shyal.com/binary-search?md=1"))
15
16        self.setCentralWidget(self.browser)
17
18        self.show()
19
20app = QApplication(sys.argv)
21window = MainWindow()
22
23app.exec_()