-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e0f4c20
commit 4820f85
Showing
3 changed files
with
26 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,21 @@ | ||
# Import tkinter and webview libraries | ||
from tkinter import * | ||
import webview | ||
import sys | ||
from PyQt5.QtCore import QUrl | ||
from PyQt5.QtWidgets import QApplication, QMainWindow | ||
from PyQt5.QtWebEngineWidgets import QWebEngineView | ||
|
||
# define an instance of tkinter | ||
tk = Tk() | ||
class MainWindow(QMainWindow): | ||
def __init__(self): | ||
super().__init__() | ||
self.setWindowTitle("Embedded Web Page") | ||
|
||
self.browser = QWebEngineView() | ||
self.setCentralWidget(self.browser) | ||
|
||
# Load URL | ||
self.browser.setUrl(QUrl('https://www.example.com')) | ||
|
||
# size of the window where we show our website | ||
tk.geometry("800x450") | ||
|
||
# Open website | ||
webview.create_window('Geeks for Geeks', 'https://geeksforgeeks.org') | ||
webview.start() | ||
if __name__ == "__main__": | ||
app = QApplication(sys.argv) | ||
window = MainWindow() | ||
window.show() | ||
sys.exit(app.exec_()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,5 @@ urllib3==2.2.1 | |
cefpython3 | ||
pygtk | ||
webkit | ||
PyQtWebEngine | ||
PyQt5 |