Python3 uses pyqt5 to create an ultra-simple browser instance, python3pyqt5

Source: Internet
Author: User

Python3 uses pyqt5 to create an ultra-simple browser instance, python3pyqt5

We use the QWebview module, which also shows the usage of QWebview.

I used to find the content on the web page for half a day.

This is the core code:

webview = Qwebview()webview.load(Qurl('http://www.cnblogs.com/Blaxon/'))webview.show()

Complete Code (the code is changed by other code ):

from PyQt5.QtCore import *from PyQt5.QtWidgets import *from PyQt5.QtWebKitWidgets import *class Form(QWidget):  def __init__(self, parent=None):    super(Form, self).__init__(parent)    tmp = QWebView()    buttonLayout1 = QVBoxLayout()    buttonLayout1.addWidget(tmp)    mainLayout = QGridLayout()    mainLayout.addLayout(buttonLayout1,)    self.setLayout(mainLayout)    self.setWindowTitle("Hello Qt")    tmp.load(QUrl('http://www.cnblogs.com/misoag/archive/2013/01/09/2853515.html'))    tmp.show()if __name__ == '__main__':  import sys  app = QApplication(sys.argv)  screen = Form()  screen.show()  sys.exit(app.exec_())

The above example of using pyqt5 to create an ultra-simple browser in python3 is all the content that I have shared with you. I hope you can provide a reference and support for the customer's house.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.