Create Your Own Browser Using Python | Python Project | PyQt5

shaikh israr
2 min readMar 3, 2021

--

In this article we can create simple web browser using python and framework PyQt5.

PyQt5

PyQt5 is a Python binding fo the cross-platform GUI toolkit QT, implemented as a toolkit plug-in. PyQt us free software developed by the British firm Riverbank Coumputing.

PytQt5 may also be embedded in C++ based application to allow of those applications to configure or enhance the functionality of those applications.

Installation

The GPL version of PyQt5 can be installed from PyPi:

pip install pyqt5
pip isntall pyqt5-sip
pip install PyqtWebEngine

The wheels include a code of the required parts of the LGPL version of Qt.

pip will also build and install the binding from the sdist package but Qt’s qmake tool must be on PATH.

After Installtions

Open your any text editior and import all the packages.

import sys
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtWebEngineWidgets import *

after the importing the all packages. Creating a class based function

class MainWindow(QMainWindow):

Create constructor

def __init__(self):
super(MainWindow, self).__init__()
self.browser = QWebEngineView()
self.browser.setUrl(QUrl('http://google.com'))
self.setCentralWidget(self.browser)
self.showMaximized()

Creating a navbar button and Button

Back button, forward button, reload button, home button.

navbar = QToolBar()
self.addToolBar(navbar)

Read full article visit :- https://hackedip.blogspot.com/2021/03/create-your-own-browser-using-python.html

--

--

shaikh israr
shaikh israr

Written by shaikh israr

Programmer | Technical Blogger | YouTuber | Passionate about learning new stuffs | Like to read

No responses yet