import sys
from PyQt5.QtWidgets import QWidget, QApplication, QLabel, QVBoxLayout
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QFont
class StopComputerWorking(QWidget):
def __init__(self):
super().__init__()
self.setStyleSheet("background: black;")
self.setWindowOpacity(0.8)
self.showFullScreen()
layout = QVBoxLayout()
layout.setAlignment(Qt.AlignHCenter | Qt.AlignCenter)
self.setLayout(layout)
label = QLabel()
label.setStyleSheet("color: red;")
label.setText("По ходу вы подхватили вирус)")
label.setAlignment(Qt.AlignCenter)
label.setFont(QFont("Arial", 40))
layout.addWidget(label)
def keyReleaseEvent(self, event):
# Закрытие на кнопку Escape
if event.key() == Qt.Key_Escape:
self.close()
super().keyReleaseEvent(event)
if __name__ == '__main__':
app = QApplication(sys.argv)
window = StopComputerWorking()
sys.exit(app.exec_())