Created
October 3, 2020 14:56
-
-
Save BoboTiG/91ece34579014cf60e63c1c756bea039 to your computer and use it in GitHub Desktop.
Sample PyInstaller spec file for PyQt5.QtWebEngineWidgets
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
# -*- mode: python -*- | |
# coding: utf-8 | |
import io | |
import os | |
import os.path | |
import re | |
import sys | |
a = Analysis( | |
[os.path.join("t.py")], | |
) | |
pyz = PYZ(a.pure, a.zipped_data) | |
exe = EXE( | |
pyz, | |
a.scripts, | |
exclude_binaries=True, | |
name="t", | |
console=False, | |
debug=False, | |
strip=False, | |
upx=False, | |
) | |
coll = COLLECT(exe, a.binaries, a.zipfiles, a.datas, name="t") | |
app = BUNDLE( | |
coll, | |
name="T.app", | |
bundle_identifier="local.t", | |
) |
The PySide2 version (python -m pip install pyside2==5.11.2
):
import sys
def main():
from PySide2.QtWidgets import QApplication
from PySide2.QtCore import QUrl
from PySide2.QtWebEngineWidgets import QWebEngineView
url = 'https://github.com/pyinstaller/pyinstaller'
app = QApplication(sys.argv)
browser = QWebEngineView()
browser.load(QUrl(url))
browser.show()
sys.exit(app.exec_())
main()
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
t.py
file (requirespython -m pip install pyqt5==5.11.3
):Compile with
python -m PyInstaller t.spec --noconfirm
.