Exception handling for PyQt5 applications
Project description
pyqtexcept
pyqtexcept
is a Python package that provides a convenient exception handling mechanism for PyQt5 applications.
It includes a function to create a custom exception hook for displaying critical errors using QMessageBox
.
Installation
You can install pyqtexcept
using pip:
pip install pyqtexcept
Usage
import sys
from PyQt5 import QtWidgets
from pyqtexcept import create_exceptions_hook
# Create a PyQt application window
app = QtWidgets.QApplication(sys.argv)
window = QtWidgets.QWidget()
# Set up the custom exception hook
sys.excepthook = create_exceptions_hook(window)
# Your PyQt application code goes here
# Start the application
window.show()
sys.exit(app.exec_())
The create_exceptions_hook
function sets up a custom exception hook using sys.excepthook
to display critical errors in a QMessageBox
.
License
This package is distributed under the MIT License. See the LICENSE file for more information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyqtexcept-0.0.1.tar.gz
(2.5 kB
view details)
Built Distribution
File details
Details for the file pyqtexcept-0.0.1.tar.gz
.
File metadata
- Download URL: pyqtexcept-0.0.1.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01ea6e11a995c71ef31c8d562bb2bb5983d3feeba91eca9d2c2fb5cf9a2b29ba |
|
MD5 | 9bc354fab2e0e577e8e09a00073c09d2 |
|
BLAKE2b-256 | 784bf82db8c74bb65e9e79f921a1e3621a56b5b1deaba205fa0021717f5e69f9 |
File details
Details for the file pyqtexcept-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: pyqtexcept-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80e66c1d34458bebfc0c4c4ed43e46c11677a48fad855d811db81882972efd79 |
|
MD5 | 759b38e4791d8338674d464f80da1ab5 |
|
BLAKE2b-256 | 2728363aa536a4fa2bb87830e30e1a41fd1c65de13dc1e046e199400865db754 |